a b/data/scripts/download_weights.sh
1
#!/bin/bash
2
# YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
3
# Download latest models from https://github.com/ultralytics/yolov5/releases
4
# Example usage: bash data/scripts/download_weights.sh
5
# parent
6
# └── yolov5
7
#     ├── yolov5s.pt  ← downloads here
8
#     ├── yolov5m.pt
9
#     └── ...
10
11
python - <<EOF
12
from utils.downloads import attempt_download
13
14
p5 = list('nsmlx')  # P5 models
15
p6 = [f'{x}6' for x in p5]  # P6 models
16
cls = [f'{x}-cls' for x in p5]  # classification models
17
seg = [f'{x}-seg' for x in p5]  # classification models
18
19
for x in p5 + p6 + cls + seg:
20
    attempt_download(f'weights/yolov5{x}.pt')
21
22
EOF