Update README.md
Browse files
README.md
CHANGED
|
@@ -37,28 +37,28 @@ model-index:
|
|
| 37 |
metrics:
|
| 38 |
- type: precision
|
| 39 |
name: Precision
|
| 40 |
-
value: 0.
|
| 41 |
- type: recall
|
| 42 |
name: Recall
|
| 43 |
-
value: 0.
|
| 44 |
- type: mAP50
|
| 45 |
name: mAP50
|
| 46 |
-
value: 0.
|
| 47 |
- type: mAP50-95
|
| 48 |
name: mAP50-95
|
| 49 |
-
value: 0.
|
| 50 |
---
|
| 51 |
|
| 52 |
# Model for detecting Hardhats and Hats
|
| 53 |
|
| 54 |
|
| 55 |
<div align="center">
|
| 56 |
-
<img width="640" alt="luisarizmendi/
|
| 57 |
</div>
|
| 58 |
|
| 59 |
## Model binary
|
| 60 |
|
| 61 |
-
You can [download the model from here](https://github.com/luisarizmendi/ai-apps/raw/refs/heads/main/models/luisarizmendi/object-
|
| 62 |
|
| 63 |
|
| 64 |
## Labels
|
|
@@ -70,11 +70,24 @@ You can [download the model from here](https://github.com/luisarizmendi/ai-apps/
|
|
| 70 |
```
|
| 71 |
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
## Model metrics
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
<div align="center">
|
| 77 |
-
<img width="640" alt="luisarizmendi/
|
| 78 |
</div>
|
| 79 |
|
| 80 |
|
|
@@ -83,12 +96,9 @@ You can [download the model from here](https://github.com/luisarizmendi/ai-apps/
|
|
| 83 |
[https://universe.roboflow.com/luisarizmendi/hardhat-or-hat](https://universe.roboflow.com/luisarizmendi/hardhat-or-hat)
|
| 84 |
|
| 85 |
|
| 86 |
-
|
| 87 |
## Model training
|
| 88 |
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
You can [review the Jupyter notebook here](https://huggingface.co/luisarizmendi/hardhat-or-hat/blob/main/train.ipynb)
|
| 92 |
|
| 93 |
### Hyperparameters
|
| 94 |
|
|
@@ -125,8 +135,7 @@ mixup=0.0, # Image mixup
|
|
| 125 |
```
|
| 126 |
|
| 127 |
|
| 128 |
-
## Usage
|
| 129 |
-
|
| 130 |
|
| 131 |
### Usage with Huggingface spaces
|
| 132 |
|
|
@@ -139,6 +148,7 @@ Remember to check that the Model URL is pointing to the model that you want to t
|
|
| 139 |
</div>
|
| 140 |
|
| 141 |
|
|
|
|
| 142 |
### Usage with Python script
|
| 143 |
|
| 144 |
Install the following PIP requirements
|
|
@@ -151,7 +161,8 @@ opencv-python
|
|
| 151 |
torch
|
| 152 |
```
|
| 153 |
|
| 154 |
-
Then [run the python code below](https://
|
|
|
|
| 155 |
|
| 156 |
```
|
| 157 |
import gradio as gr
|
|
@@ -161,7 +172,7 @@ import os
|
|
| 161 |
import cv2
|
| 162 |
import torch
|
| 163 |
|
| 164 |
-
DEFAULT_MODEL_URL = "https://github.com/luisarizmendi/ai-apps/raw/refs/heads/main/models/luisarizmendi/object-
|
| 165 |
|
| 166 |
def detect_objects_in_files(model_input, files):
|
| 167 |
"""
|
|
@@ -213,4 +224,9 @@ interface = gr.Interface(
|
|
| 213 |
|
| 214 |
if __name__ == "__main__":
|
| 215 |
interface.launch()
|
| 216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
metrics:
|
| 38 |
- type: precision
|
| 39 |
name: Precision
|
| 40 |
+
value: 0.844
|
| 41 |
- type: recall
|
| 42 |
name: Recall
|
| 43 |
+
value: 0.847
|
| 44 |
- type: mAP50
|
| 45 |
name: mAP50
|
| 46 |
+
value: 0.893
|
| 47 |
- type: mAP50-95
|
| 48 |
name: mAP50-95
|
| 49 |
+
value: 0.546
|
| 50 |
---
|
| 51 |
|
| 52 |
# Model for detecting Hardhats and Hats
|
| 53 |
|
| 54 |
|
| 55 |
<div align="center">
|
| 56 |
+
<img width="640" alt="luisarizmendi/hardhat-or-hat" src="example.png">
|
| 57 |
</div>
|
| 58 |
|
| 59 |
## Model binary
|
| 60 |
|
| 61 |
+
You can [download the model from here](https://github.com/luisarizmendi/ai-apps/raw/refs/heads/main/models/luisarizmendi/object-detection-hardhat-or-hat/object-detection-hardhat-or-hat-m.pt)
|
| 62 |
|
| 63 |
|
| 64 |
## Labels
|
|
|
|
| 70 |
```
|
| 71 |
|
| 72 |
|
| 73 |
+
## Base Model
|
| 74 |
+
|
| 75 |
+
Ultralytics/YOLO11m
|
| 76 |
+
|
| 77 |
## Model metrics
|
| 78 |
|
| 79 |
+
```
|
| 80 |
+
YOLO11m summary (fused): 303 layers, 20,032,345 parameters, 0 gradients, 67.7 GFLOPs
|
| 81 |
+
Class Images Instances Box(P R mAP50 mAP50-95)
|
| 82 |
+
all 1992 15306 0.844 0.847 0.893 0.546
|
| 83 |
+
hat 244 287 0.869 0.811 0.876 0.578
|
| 84 |
+
helmet 1202 3942 0.916 0.892 0.942 0.61
|
| 85 |
+
no_helmet 741 11077 0.746 0.838 0.861 0.45
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
|
| 89 |
<div align="center">
|
| 90 |
+
<img width="640" alt="luisarizmendi/hardhat-or-hat" src="confusion_matrix_normalized.png"> <img width="640" alt="luisarizmendi/hardhat-or-hat" src="results.png">
|
| 91 |
</div>
|
| 92 |
|
| 93 |
|
|
|
|
| 96 |
[https://universe.roboflow.com/luisarizmendi/hardhat-or-hat](https://universe.roboflow.com/luisarizmendi/hardhat-or-hat)
|
| 97 |
|
| 98 |
|
|
|
|
| 99 |
## Model training
|
| 100 |
|
| 101 |
+
You can [review the Jupyter notebook here](https://github.com/luisarizmendi/ai-apps/blob/main/dev/hardhat-or-hat/train.ipynb)
|
|
|
|
|
|
|
| 102 |
|
| 103 |
### Hyperparameters
|
| 104 |
|
|
|
|
| 135 |
```
|
| 136 |
|
| 137 |
|
| 138 |
+
## Model Usage
|
|
|
|
| 139 |
|
| 140 |
### Usage with Huggingface spaces
|
| 141 |
|
|
|
|
| 148 |
</div>
|
| 149 |
|
| 150 |
|
| 151 |
+
|
| 152 |
### Usage with Python script
|
| 153 |
|
| 154 |
Install the following PIP requirements
|
|
|
|
| 161 |
torch
|
| 162 |
```
|
| 163 |
|
| 164 |
+
Then [run the python code below ](https://github.com/luisarizmendi/ai-apps/raw/refs/heads/main/models/luisarizmendi/object-detector-hardhat-or-hat/run_model.py) and open `http://localhost:7860` in a browser to upload and scan the images.
|
| 165 |
+
|
| 166 |
|
| 167 |
```
|
| 168 |
import gradio as gr
|
|
|
|
| 172 |
import cv2
|
| 173 |
import torch
|
| 174 |
|
| 175 |
+
DEFAULT_MODEL_URL = "https://github.com/luisarizmendi/ai-apps/raw/refs/heads/main/models/luisarizmendi/object-detection-hardhat-or-hat/object-detection-hardhat-or-hat-m.pt"
|
| 176 |
|
| 177 |
def detect_objects_in_files(model_input, files):
|
| 178 |
"""
|
|
|
|
| 224 |
|
| 225 |
if __name__ == "__main__":
|
| 226 |
interface.launch()
|
| 227 |
+
|
| 228 |
+
```
|
| 229 |
+
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+
|