How to use from the
Use from the
ultralytics library
# 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)

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:

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.

Downloads last month
19
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Space using Ashgibbs/Cosmetic_Defect_Detection 1