File size: 1,840 Bytes
98c7e02
ee5b050
 
 
 
 
 
 
98c7e02
 
 
88225ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae7b16f
88225ba
 
 
 
 
 
 
 
ae7b16f
88225ba
ae7b16f
88225ba
ae7b16f
88225ba
 
ae7b16f
88225ba
 
ee5b050
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
title: Metal Surface Defect Detection - YOLOv8
emoji: πŸ”
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
---

# πŸ” Metal Surface Defect Detection β€” YOLOv8 (HF Space)

This Hugging Face Space provides an interactive **YOLOv8 Small (YOLOv8s)** model for detecting and localizing defects in forged metal surfaces.

The model is trained on a custom industrial dataset containing **10 defect categories**, and can identify & localize defects directly from uploaded images.

---

# 🧠 **About the Model**

This model comes from the repository:

➑️ **`code0ut/metal-defect-yolo`**

It was trained using:

- **YOLOv8s** (Ultralytics)
- **50 epochs**
- **640Γ—640 image size**
- **AdamW optimizer (auto-selected)**
- **Google Colab T4 GPU**

The model was exported as `best.pt` and is automatically downloaded from the Hugging Face Hub when the Space loads.

---

# 🏷️ **Defect Classes (10 Total)**

The detector can identify the following metal surface defects:

1. punching_hole  
2. welding_line  
3. crescent_gap  
4. water_spot  
5. oil_spot  
6. silk_spot  
7. inclusion  
8. rolled_pit  
9. crease  
10. waist_folding  

These categories are common in industrial quality inspection systems used for forged or rolled metal products.

---

# πŸš€ **How to Use the Space**

Upload any metal surface image using the UI.  
The model will:

- Run YOLOv8 inference  
- Display bounding boxes  
- Show class labels & confidence scores  
- Return a processed output image  

No code is needed β€” everything runs inside the browser.

---

# πŸ§ͺ **Using the Model Programmatically (Python)**

You can also use the model directly in your Python environment:

```python
from ultralytics import YOLO

model = YOLO("code0ut/metal-defect-yolo")
results = model("image.jpg")
results.show()