Last active
July 18, 2022 11:55
-
-
Save adujardin/0147fea01fc0e508a853433fc2053a4a to your computer and use it in GitHub Desktop.
Yolov5 accuracy test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#docker run --gpus=all -it -v /:/host/ nvcr.io/nvidia/pytorch:22.02-py3 | |
host_folder="/host/tmp/yolov5_results.txt" | |
rm ${host_folder} | |
git clone https://github.com/ultralytics/yolov5 | |
cd yolov5 | |
pip install -qr requirements.txt | |
rm requirements.txt | |
pip uninstall opencv-python | |
pip install opencv-python-headless==4.4.0.40 ujson | |
#wget https://github.com/ultralytics/yolov5/releases/download/v1.0/coco2017val.zip | |
#unzip -q coco2017val.zip -d ../ && rm coco2017val.zip | |
# apt update ; apt-get install libfreetype6-dev -y ; pip install -U pillow | |
yolov5_variants=("yolov5n" "yolov5s" "yolov5m" "yolov5l" "yolov5x") | |
image_sizes=("320" "384" "416" "512" "608" "640") | |
for variant in "${yolov5_variants[@]}"; do | |
for size in "${image_sizes[@]}"; do | |
echo -e "------ ${variant} ${size} ------" >> ${host_folder} 2>&1 | |
python val.py --weights ${variant}.pt --data coco.yaml --batch-size 8 --img ${size} --conf 0.001 --iou 0.65 --save-txt --verbose 2>&1 | tee -a ${host_folder} # mAP | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment