You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
| YOLOv5s Baseline | The baseline, small YOLOv5 model used as the starting point for sparsification. | ``` python train.py --cfg ../models/yolov5s.yaml --weights "" --data coco.yaml --hyp data/hyp.scratch.yaml ``` | 0.556 | 24.8 MB | 78.2 img/sec |
154
-
| [YOLOv5s Pruned](https://github.com/neuralmagic/sparseml/blob/main/integrations/ultralytics-yolov5/recipes/yolov5s.pruned.md) | Creates a highly sparse, FP32 YOLOv5s model that recovers close to the baseline model. | ``` python train.py --cfg ../models/yolov5s.yaml --weights PATH_TO_COCO_PRETRAINED_WEIGHTS --data coco.yaml --hyp data/hyp.scratch.yaml --recipe ../recipes/yolov5s.pruned.md ``` | 0.534 | 8.4 MB | 100.5 img/sec |
155
-
| [YOLOv5s Pruned Quantized](https://github.com/neuralmagic/sparseml/blob/main/integrations/ultralytics-yolov5/recipes/yolov5s.pruned_quantized.md) | Creates a highly sparse, INT8 YOLOv5s model that recovers reasonably close to the baseline model. | ``` python train.py --cfg ../models/yolov5s.yaml --weights PATH_TO_COCO_PRETRAINED_WEIGHTS --data coco.yaml --hyp data/hyp.scratch.yaml --recipe ../recipes/yolov5s.pruned_quantized.md ``` | 0.525 | 3.3 MB | 198.2 img/sec |
156
-
| YOLOv5l Baseline | The baseline, large YOLOv5 model used as the starting point for sparsification. | ``` python train.py --cfg ../models/yolov5l.yaml --weights "" --data coco.yaml --hyp data/hyp.scratch.yaml ``` | 0.654 | 154 MB | 22.7 img/sec |
157
-
| [YOLOv5l Pruned](https://github.com/neuralmagic/sparseml/blob/main/integrations/ultralytics-yolov5/recipes/yolov5l.pruned.md) | Creates a highly sparse, FP32 YOLOv5l model that recovers close to the baseline model. | ``` python train.py --cfg ../models/yolov5l.yaml --weights PATH_TO_COCO_PRETRAINED_WEIGHTS --data coco.yaml --hyp data/hyp.scratch.yaml --recipe ../recipes/yolov5l.pruned.md ``` | 0.643 | 32.8 MB | 40.1 img/sec |
158
-
| [YOLOv5l Pruned Quantized](https://github.com/neuralmagic/sparseml/blob/main/integrations/ultralytics-yolov5/recipes/yolov5l.pruned_quantized.md) | Creates a highly sparse, INT8 YOLOv5l model that recovers reasonably close to the baseline model. | ``` python train.py --cfg ../models/yolov5l.yaml --weights PATH_TO_COCO_PRETRAINED_WEIGHTS --data coco.yaml --hyp data/hyp.scratch.yaml --recipe ../recipes/yolov5l.pruned_quantized.md ``` | 0.623 | 12.7 MB | 98.6 img/sec |
153
+
| YOLOv5s Baseline | The baseline, small YOLOv5 model used as the starting point for sparsification. | ``` python train.py --cfg ../models_v5.0/yolov5s.yaml --weights "" --data coco.yaml --hyp data/hyps/hyp.scratch.yaml ``` | 0.556 | 24.8 MB | 78.2 img/sec |
154
+
| [YOLOv5s Pruned](https://github.com/neuralmagic/sparseml/blob/main/integrations/ultralytics-yolov5/recipes/yolov5s.pruned.md) | Creates a highly sparse, FP32 YOLOv5s model that recovers close to the baseline model. | ``` python train.py --cfg ../models_v5.0/yolov5s.yaml --weights PATH_TO_COCO_PRETRAINED_WEIGHTS --data coco.yaml --hyp data/hyps/hyp.scratch.yaml --recipe ../recipes/yolov5s.pruned.md ``` | 0.534 | 8.4 MB | 100.5 img/sec |
155
+
| [YOLOv5s Pruned Quantized](https://github.com/neuralmagic/sparseml/blob/main/integrations/ultralytics-yolov5/recipes/yolov5s.pruned_quantized.md) | Creates a highly sparse, INT8 YOLOv5s model that recovers reasonably close to the baseline model. | ``` python train.py --cfg ../models_v5.0/yolov5s.yaml --weights PATH_TO_COCO_PRETRAINED_WEIGHTS --data coco.yaml --hyp data/hyps/hyp.scratch.yaml --recipe ../recipes/yolov5s.pruned_quantized.md ``` | 0.525 | 3.3 MB | 198.2 img/sec |
156
+
| YOLOv5l Baseline | The baseline, large YOLOv5 model used as the starting point for sparsification. | ``` python train.py --cfg ../models_v5.0/yolov5l.yaml --weights "" --data coco.yaml --hyp data/hyps/hyp.scratch.yaml ``` | 0.654 | 154 MB | 22.7 img/sec |
157
+
| [YOLOv5l Pruned](https://github.com/neuralmagic/sparseml/blob/main/integrations/ultralytics-yolov5/recipes/yolov5l.pruned.md) | Creates a highly sparse, FP32 YOLOv5l model that recovers close to the baseline model. | ``` python train.py --cfg ../models_v5.0/yolov5l.yaml --weights PATH_TO_COCO_PRETRAINED_WEIGHTS --data coco.yaml --hyp data/hyps/hyp.scratch.yaml --recipe ../recipes/yolov5l.pruned.md ``` | 0.643 | 32.8 MB | 40.1 img/sec |
158
+
| [YOLOv5l Pruned Quantized](https://github.com/neuralmagic/sparseml/blob/main/integrations/ultralytics-yolov5/recipes/yolov5l.pruned_quantized.md) | Creates a highly sparse, INT8 YOLOv5l model that recovers reasonably close to the baseline model. | ``` python train.py --cfg ../models_v5.0/yolov5l.yaml --weights PATH_TO_COCO_PRETRAINED_WEIGHTS --data coco.yaml --hyp data/hyps/hyp.scratch.yaml --recipe ../recipes/yolov5l.pruned_quantized.md ``` | 0.623 | 12.7 MB | 98.6 img/sec |
159
159
160
160
** DeepSparse Performance measured on an AWS C5 instance with 24 cores, batch size 64, and 640x640 input with version 1.6 of the DeepSparse Engine.
161
161
@@ -175,7 +175,7 @@ The table below compares these tradeoffs and shows how to run them on the COCO d
175
175
3. To begin applying one of the recipes, use the `--recipe` argument within the Ultralytics [train script](https://github.com/neuralmagic/yolov5/blob/master/train.py).
176
176
The recipe argument is combined with our previous training command and COCO pre-trained weights to run the recipes over the model. For example, a command for YOLOv5s would look like this:
After applying a recipe, you are ready to export for inference.
181
181
@@ -218,12 +218,12 @@ The `best.pt` file contains a checkpoint of the best weights measured on the val
218
218
These weights can be loaded into the `train.py` and `test.py` scripts now.
219
219
However, other formats are generally more friendly for other inference deployment platforms, such as [ONNX](https://onnx.ai/).
220
220
221
-
The [`export.py` script](https://github.com/neuralmagic/yolov5/blob/master/models/export.py) handles the logic behind loading the checkpoint and converting it into the more common inference formats, as described here.
221
+
The [`export.py` script](https://github.com/neuralmagic/yolov5/blob/master/export.py) handles the logic behind loading the checkpoint and converting it into the more common inference formats, as described here.
222
222
223
223
1. Enter the following command to load the PyTorch graph, convert to ONNX, and correct any misformatted pieces of the graph for the pruned and quantized models.
@@ -200,11 +200,11 @@ The `best.pt` file, located in the previous step, contains a checkpoint of the b
200
200
These weights can be loaded into the `train.py` and `test.py` scripts now.
201
201
However, other formats are generally more friendly for other inference deployment platforms, such as [ONNX](https://onnx.ai/).
202
202
203
-
The [export.py script](https://github.com/neuralmagic/yolov5/blob/master/models/export.py) handles the logic behind loading the checkpoint and converting it into the more common inference formats, as described here.
203
+
The [export.py script](https://github.com/neuralmagic/yolov5/blob/master/export.py) handles the logic behind loading the checkpoint and converting it into the more common inference formats, as described here.
204
204
205
205
1. Enter the following command to load the PyTorch graph, convert to ONNX, and correct any misformatted pieces of the graph for the pruned and quantized models.
0 commit comments