Tanishjain9 commited on
Commit
a2c1a97
Β·
verified Β·
1 Parent(s): 187d860

Update README.md

Browse files

## 🀝 Thanks / Contact

For improvements, issues, or contributions β€” feel free to open a Pull Request or Discussion.

**Author:** **Tanish Jain**

Files changed (1) hide show
  1. README.md +105 -86
README.md CHANGED
@@ -1,21 +1,39 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
3
  ---
4
- # Model Card: YOLOv8n PPE Detection (6 Classes)
5
 
6
- ## 1. Model Details
7
 
8
- - **Model name**: YOLOv8n PPE Detection – 6 Classes
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
- ### Classes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  | ID | Class Name | Image Count |
21
  |----|--------------|-------------|
@@ -28,76 +46,86 @@ license: mit
28
 
29
  ---
30
 
31
- ## 2. Intended Use
32
 
33
- ### Primary use-cases
34
 
35
- - Workplace safety monitoring on:
36
- - Construction sites
37
- - Industrial plants
38
- - Warehouses and logistics hubs
39
- - Real-time PPE compliance monitoring:
40
- - Detect whether workers wear helmets, vests, gloves, masks, goggles, and safety shoes.
 
 
 
 
41
 
42
- ### Target platforms
43
 
44
- - NVIDIA Jetson Orin / Orin Nano / Xavier / Laptop
45
- - Edge devices using:
46
- - ONNX Runtime
47
- - TensorRT (FP16 / INT8)
48
- - NVIDIA DeepStream
49
 
50
- ### Not intended for
51
 
52
- - Legal or regulatory compliance **without human supervision**
53
- - Medical or clinical decisions
54
- - Surveillance in sensitive environments without proper consent/authorization
 
55
 
56
- **Important**: This model should be used as a **support tool**. Final decisions should always be made by a human.
57
 
58
  ---
59
 
60
- ## 3. Training Data
61
 
62
- - **Dataset type**: PPE detection dataset (6 classes)
63
- - **Images**: mix of indoor/outdoor scenes, workers wearing different PPE combinations
64
- - **Annotation format**: YOLO format (class_id x_center y_center width height, normalized)
65
- - **Train / Validation / Test split**:
66
- - Train: majority of images
67
- - Validation: held-out subset for tuning
68
- - Test: separate hold-out, not used in training
69
 
70
- Data is skewed slightly toward **Vest** and **Gloves**, with fewer examples for **safety_shoe** and **goggles**, which can affect per-class performance.
 
 
71
 
72
  ---
73
 
74
- ## 4. Training Procedure
75
-
76
- - **Base model**: `yolov8n.pt` (pretrained on COCO)
77
- - **Training script**: Ultralytics `yolo train`
78
- - **Key hyperparameters**:
79
- - `epochs`: 50
80
- - `imgsz`: 640
81
- - `batch`: 32 (T4 GPU)
82
- - `optimizer`: auto (SGD/AdamW depending on Ultralytics config)
83
- - **Loss & augmentations**:
84
- - Default Ultralytics YOLOv8 settings
85
- - Mosaic, random flip, color jitter (HSV), scaling, translation
 
 
 
86
 
87
  ---
88
 
89
- ## 5. Evaluation & Metrics
90
 
91
- Validation was run with Ultralytics default `val` pipeline.
92
 
93
- **Overall performance:**
 
 
 
 
 
94
 
95
- - **mAP@50**: ~0.81
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
- ## 6. Limitations & Ethical Considerations
116
 
117
- ### Technical limitations
118
 
119
- - Performance may degrade in:
120
- - Very low light
121
- - Motion blur (fast movement)
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
- ### Data & bias
127
 
128
- - Training data may not represent **all industries, uniforms, skin tones, or environments** globally.
129
- - PPE styles (helmet colors, vest types, shoe styles) may differ from the training distribution, impacting accuracy.
130
 
131
- ### Responsible use
132
 
133
- - Do **not** use this model as the only mechanism to enforce safety or compliance.
134
- - Always include:
135
- - Human oversight
136
- - Clear communication to workers about monitoring
137
- - Respect for privacy and local regulations
138
 
139
  ---
140
 
141
- ## 7. How to Use
142
 
143
- ### Ultralytics (.pt) – Python example
144
 
145
  ```python
146
  from ultralytics import YOLO
147
 
148
  model = YOLO("best.pt")
149
- results = model("image.jpg", imgsz=640, conf=0.25)
150
 
151
- for r in results:
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