Update README.md
Browse files## π€ Thanks / Contact
For improvements, issues, or contributions β feel free to open a Pull Request or Discussion.
**Author:** **Tanish Jain**
README.md
CHANGED
|
@@ -1,21 +1,39 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
-
# Model Card: YOLOv8n PPE Detection (6 Classes)
|
| 5 |
|
| 6 |
-
|
| 7 |
|
| 8 |
-
|
| 9 |
-
- **Architecture**: Ultralytics YOLOv8n (nano variant)
|
| 10 |
-
- **Task**: Object Detection (PPE / safety gear)
|
| 11 |
-
- **Framework**: PyTorch (Ultralytics), exported to ONNX
|
| 12 |
-
- **Input size**: `1 Γ 3 Γ 640 Γ 640` (RGB, normalized 0β1)
|
| 13 |
-
- **Output shape (ONNX)**: `1 Γ 10 Γ 8400`
|
| 14 |
-
- 4 channels: bounding box (x, y, w, h)
|
| 15 |
-
- 6 channels: class probabilities
|
| 16 |
-
- **Number of classes**: 6
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
| ID | Class Name | Image Count |
|
| 21 |
|----|--------------|-------------|
|
|
@@ -28,76 +46,86 @@ license: mit
|
|
| 28 |
|
| 29 |
---
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
### Primary use-cases
|
| 34 |
|
| 35 |
-
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
-
|
| 40 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
### Target
|
| 43 |
|
| 44 |
-
- NVIDIA Jetson Orin
|
| 45 |
-
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
|
| 50 |
-
### Not intended for
|
| 51 |
|
| 52 |
-
- Legal
|
| 53 |
-
- Medical or clinical decisions
|
| 54 |
-
- Surveillance
|
|
|
|
| 55 |
|
| 56 |
-
|
| 57 |
|
| 58 |
---
|
| 59 |
|
| 60 |
-
|
| 61 |
|
| 62 |
-
- **Dataset
|
| 63 |
-
- **
|
| 64 |
-
- **
|
| 65 |
-
- **
|
| 66 |
-
- Train: majority
|
| 67 |
-
-
|
| 68 |
-
- Test: separate
|
| 69 |
|
| 70 |
-
|
|
|
|
|
|
|
| 71 |
|
| 72 |
---
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
- **Base model
|
| 77 |
-
- **
|
| 78 |
-
- **
|
| 79 |
-
- `epochs
|
| 80 |
-
- `imgsz
|
| 81 |
-
- `batch
|
| 82 |
-
- `optimizer
|
| 83 |
-
- **
|
| 84 |
-
-
|
| 85 |
-
-
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
---
|
| 88 |
|
| 89 |
-
|
| 90 |
|
| 91 |
-
|
| 92 |
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
-
-
|
| 96 |
-
- **mAP@50β95**: ~0.53
|
| 97 |
-
- **Precision**: ~0.80
|
| 98 |
-
- **Recall**: ~0.74
|
| 99 |
-
|
| 100 |
-
**Per-class mAP@50 (approx)**:
|
| 101 |
|
| 102 |
| Class | mAP@50 |
|
| 103 |
|--------------|--------|
|
|
@@ -108,46 +136,37 @@ Validation was run with Ultralytics default `val` pipeline.
|
|
| 108 |
| mask | ~0.80 |
|
| 109 |
| safety_shoe | ~0.64 |
|
| 110 |
|
| 111 |
-
These numbers are approximate and can vary slightly based on exact validation configuration.
|
| 112 |
-
|
| 113 |
---
|
| 114 |
|
| 115 |
-
|
| 116 |
|
| 117 |
-
### Technical
|
| 118 |
|
| 119 |
-
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
- Heavy occlusion (crowded scenes)
|
| 123 |
-
- Extremely small objects (far-away workers)
|
| 124 |
-
- Model expects image shape 640Γ640; non-square / very different aspect ratios may slightly reduce accuracy.
|
| 125 |
|
| 126 |
-
###
|
| 127 |
|
| 128 |
-
-
|
| 129 |
-
-
|
| 130 |
|
| 131 |
-
### Responsible
|
| 132 |
|
| 133 |
-
-
|
| 134 |
-
-
|
| 135 |
-
|
| 136 |
-
- Clear communication to workers about monitoring
|
| 137 |
-
- Respect for privacy and local regulations
|
| 138 |
|
| 139 |
---
|
| 140 |
|
| 141 |
-
|
| 142 |
|
| 143 |
-
|
| 144 |
|
| 145 |
```python
|
| 146 |
from ultralytics import YOLO
|
| 147 |
|
| 148 |
model = YOLO("best.pt")
|
| 149 |
-
results = model("image.jpg", imgsz=640
|
| 150 |
|
| 151 |
-
|
| 152 |
-
print(r.boxes.cls, r.boxes.conf, r.boxes.xyxy)
|
| 153 |
-
r.show() # show window
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- yolo
|
| 5 |
+
- yolov8
|
| 6 |
+
- object-detection
|
| 7 |
+
- ppe
|
| 8 |
+
- safety-detection
|
| 9 |
+
- onnx
|
| 10 |
+
- jetson
|
| 11 |
+
- edge-ai
|
| 12 |
---
|
|
|
|
| 13 |
|
| 14 |
+
# π¦Ί YOLOv8n PPE Detection (6 Classes)
|
| 15 |
|
| 16 |
+
A lightweight and fast Personal Protective Equipment (PPE) detection model trained on 6 safety classes, optimized for edge devices such as **NVIDIA Jetson Orin**, **ONNX Runtime**, and **TensorRT** deployment.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# 1. π Model Details
|
| 21 |
+
|
| 22 |
+
- **Model name:** YOLOv8n PPE Detection β 6 Classes
|
| 23 |
+
- **Architecture:** Ultralytics YOLOv8n (Nano)
|
| 24 |
+
- **Task:** Object Detection (PPE / Safety Gear)
|
| 25 |
+
- **Framework:** PyTorch (Ultralytics), exported to ONNX
|
| 26 |
+
- **Input size:** `1 Γ 3 Γ 640 Γ 640`
|
| 27 |
+
- **Output shape (ONNX):** `1 Γ 10 Γ 8400`
|
| 28 |
+
- 4 channels β bounding box (x, y, w, h)
|
| 29 |
+
- 6 channels β class logits
|
| 30 |
+
- **Number of classes:** `6`
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
# 2. π·οΈ Classes & Dataset Distribution
|
| 35 |
+
|
| 36 |
+
### **Class List with Image Counts**
|
| 37 |
|
| 38 |
| ID | Class Name | Image Count |
|
| 39 |
|----|--------------|-------------|
|
|
|
|
| 46 |
|
| 47 |
---
|
| 48 |
|
| 49 |
+
# 3. π― Intended Use
|
| 50 |
|
| 51 |
+
### **Primary use-cases**
|
| 52 |
|
| 53 |
+
- Real-time PPE compliance monitoring
|
| 54 |
+
- Construction site safety analytics
|
| 55 |
+
- Industrial / warehouse safety automation
|
| 56 |
+
- Worker equipment detection on:
|
| 57 |
+
- Helmets
|
| 58 |
+
- Safety shoes
|
| 59 |
+
- Reflective vests
|
| 60 |
+
- Gloves
|
| 61 |
+
- Masks
|
| 62 |
+
- Goggles
|
| 63 |
|
| 64 |
+
### **Target Platforms**
|
| 65 |
|
| 66 |
+
- NVIDIA Jetson (Orin Nano, Orin NX, Xavier NX)
|
| 67 |
+
- ONNX Runtime
|
| 68 |
+
- TensorRT (FP32 / FP16 / INT8)
|
| 69 |
+
- NVIDIA DeepStream SDK
|
| 70 |
+
- Python (Ultralytics inference)
|
| 71 |
|
| 72 |
+
### **Not intended for**
|
| 73 |
|
| 74 |
+
- Legal enforcement without human review
|
| 75 |
+
- Medical or clinical decisions
|
| 76 |
+
- Surveillance without consent
|
| 77 |
+
- Environments restricted by privacy regulations
|
| 78 |
|
| 79 |
+
> β οΈ **Human supervision is mandatory for high-risk applications.**
|
| 80 |
|
| 81 |
---
|
| 82 |
|
| 83 |
+
# 4. π Training Data
|
| 84 |
|
| 85 |
+
- **Dataset source:** Custom PPE dataset (Roboflow format)
|
| 86 |
+
- **Annotation format:** YOLO TXT
|
| 87 |
+
- **Data types:** Indoor/outdoor industrial environments
|
| 88 |
+
- **Split:**
|
| 89 |
+
- Train: majority
|
| 90 |
+
- Val: held-out validation
|
| 91 |
+
- Test: separate set for unbiased evaluation
|
| 92 |
|
| 93 |
+
Dataset is slightly imbalanced:
|
| 94 |
+
- **Vest** is most common
|
| 95 |
+
- **safety_shoe** & **goggles** have fewer samples
|
| 96 |
|
| 97 |
---
|
| 98 |
|
| 99 |
+
# 5. βοΈ Training Procedure
|
| 100 |
+
|
| 101 |
+
- **Base model:** `yolov8n.pt` (COCO pretrained)
|
| 102 |
+
- **Framework:** Ultralytics YOLOv8
|
| 103 |
+
- **Hyperparameters:**
|
| 104 |
+
- `epochs = 50`
|
| 105 |
+
- `imgsz = 640`
|
| 106 |
+
- `batch = 32`
|
| 107 |
+
- `optimizer = auto`
|
| 108 |
+
- **Augmentations:**
|
| 109 |
+
- Mosaic
|
| 110 |
+
- HSV color shift
|
| 111 |
+
- Random flip
|
| 112 |
+
- Scaling
|
| 113 |
+
- Translation
|
| 114 |
|
| 115 |
---
|
| 116 |
|
| 117 |
+
# 6. π Evaluation & Metrics
|
| 118 |
|
| 119 |
+
### **Overall Performance**
|
| 120 |
|
| 121 |
+
| Metric | Value |
|
| 122 |
+
|-----------------|-------|
|
| 123 |
+
| mAP@50 | ~0.81 |
|
| 124 |
+
| mAP@50β95 | ~0.53 |
|
| 125 |
+
| Precision | ~0.80 |
|
| 126 |
+
| Recall | ~0.74 |
|
| 127 |
|
| 128 |
+
### **Per-Class mAP@50**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
| Class | mAP@50 |
|
| 131 |
|--------------|--------|
|
|
|
|
| 136 |
| mask | ~0.80 |
|
| 137 |
| safety_shoe | ~0.64 |
|
| 138 |
|
|
|
|
|
|
|
| 139 |
---
|
| 140 |
|
| 141 |
+
# 7. β οΈ Limitations & Ethical Considerations
|
| 142 |
|
| 143 |
+
### **Technical**
|
| 144 |
|
| 145 |
+
- Sensitive to low-light & motion blur
|
| 146 |
+
- Small distant objects can reduce accuracy
|
| 147 |
+
- PPE variations (colors, styles, regional differences) may affect performance
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
+
### **Bias & Data Risks**
|
| 150 |
|
| 151 |
+
- Dataset may not represent all ethnicities, industries, or regions globally
|
| 152 |
+
- Model may fail on unseen uniform types or PPE color variations
|
| 153 |
|
| 154 |
+
### **Responsible AI Guidance**
|
| 155 |
|
| 156 |
+
- Always include human review
|
| 157 |
+
- Follow local privacy laws (GDPR, workplace regulations)
|
| 158 |
+
- Use only for transparent, ethical monitoring
|
|
|
|
|
|
|
| 159 |
|
| 160 |
---
|
| 161 |
|
| 162 |
+
# 8. π How to Use
|
| 163 |
|
| 164 |
+
## **A) Inference with Ultralytics (.pt)**
|
| 165 |
|
| 166 |
```python
|
| 167 |
from ultralytics import YOLO
|
| 168 |
|
| 169 |
model = YOLO("best.pt")
|
| 170 |
+
results = model("image.jpg", imgsz=640)
|
| 171 |
|
| 172 |
+
results[0].show() # visualize
|
|
|
|
|
|