Instructions to use Ashgibbs/Cosmetic_Defect_Detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use Ashgibbs/Cosmetic_Defect_Detection with ultralytics:
# Couldn't find a valid YOLO version tag. # Replace XX with the correct version. from ultralytics import YOLOvXX model = YOLOvXX.from_pretrained("Ashgibbs/Cosmetic_Defect_Detection") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
| language: en | |
| license: mit | |
| tags: | |
| - yolo | |
| - ultralytics | |
| - object-detection | |
| - defect-detection | |
| - industrial-inspection | |
| # Cosmetic Defect Detection (YOLOv8) | |
| This model is a YOLOv8-based object detection model trained to identify cosmetic defects on metal surfaces. | |
| ## Model Details | |
| - **Architecture**: YOLOv8n (Weights: `best.pt`) | |
| - **Task**: Object Detection | |
| - **Classes**: | |
| - `Crazing` | |
| - `Inclusion` | |
| - `Patches` | |
| - `Pitted` | |
| - `Rolled-in Scale` | |
| - `Scratches` | |
| ## Training Results | |
| The model was trained on the **Metal Surface Defect Dataset (NEU)**. Training results, including confusion matrices and performance plots, are available as files in this repository. | |
| ### Performance | |
| - **Confusion Matrix**: See `confusion_matrix.png` | |
| - **Results Plot**: See `results.png` | |
| ## How to use | |
| You can load this model using the `ultralytics` library: | |
| ```python | |
| from ultralytics import YOLO | |
| from huggingface_hub import hf_hub_download | |
| # Download the model weights | |
| model_path = hf_hub_download(repo_id="Ashgibbs/Cosmetic_Defect_Detection", filename="best.pt") | |
| # Load the model | |
| model = YOLO(model_path) | |
| # Run inference | |
| results = model.predict("path/to/image.jpg") | |
| results[0].show() | |
| ``` | |
| ## Dataset Credit | |
| The training was conducted using the NEU Surface Defect Dataset. | |