Created using Colaboratory

This commit is contained in:
Glenn Jocher committed 2022-08-16 13:33:59 +02:00
1 parent 4d05472d2b
commit 1f5a28711d
1 file changed
+26 -25
+26 -25
View File
@@ -1014,23 +1014,9 @@
"source": [
"# Appendix\n",
"\n",
"Optional extras below. Unit tests validate repo functionality and should be run on any PRs submitted.\n"
"Additional content below for PyTorch Hub, CI, reproducing results, profiling speeds, VOC training, classification training and TensorRT example."
]
},
{
"cell_type": "code",
"metadata": {
"id": "mcKoSIK2WSzj"
},
"source": [
"# Reproduce\n",
"for x in 'yolov5n', 'yolov5s', 'yolov5m', 'yolov5l', 'yolov5x':\n",
" !python val.py --weights {x}.pt --data coco.yaml --img 640 --task speed # speed\n",
" !python val.py --weights {x}.pt --data coco.yaml --img 640 --conf 0.001 --iou 0.65 # mAP"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
@@ -1080,6 +1066,20 @@
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "mcKoSIK2WSzj"
},
"source": [
"# Reproduce\n",
"for x in (f'yolov5{x}' for x in 'nsmlx'):\n",
" !python val.py --weights {x}.pt --data coco.yaml --img 640 --task speed # speed\n",
" !python val.py --weights {x}.pt --data coco.yaml --img 640 --conf 0.001 --iou 0.65 # mAP"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
@@ -1099,26 +1099,27 @@
{
"cell_type": "code",
"metadata": {
"id": "RVRSOhEvUdb5"
"id": "BSgFCAcMbk1R"
},
"source": [
"# Evolve\n",
"!python train.py --img 640 --batch 64 --epochs 100 --data coco128.yaml --weights yolov5s.pt --cache --noautoanchor --evolve\n",
"!d=runs/train/evolve && cp evolve.* $d && zip -r evolve.zip $d && gsutil mv evolve.zip gs://bucket # upload results (optional)"
"# VOC\n",
"for b, m in zip([64, 64, 64, 32, 16], [f'yolov5{x}' for x in 'nsmlx']): # batch, model\n",
" !python train.py --batch {b} --weights {m}.pt --data VOC.yaml --epochs 50 --img 512 --hyp hyp.VOC.yaml --project VOC --name {m} --cache"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "BSgFCAcMbk1R"
},
"source": [
"# VOC\n",
"for b, m in zip([64, 64, 64, 32, 16], ['yolov5n', 'yolov5s', 'yolov5m', 'yolov5l', 'yolov5x']): # batch, model\n",
" !python train.py --batch {b} --weights {m}.pt --data VOC.yaml --epochs 50 --img 512 --hyp hyp.VOC.yaml --project VOC --name {m} --cache"
"# Classification\n",
"for m in *(f'yolov5{x}.pt' for x in 'nsmlx'), 'resnet50.pt', 'efficientnet_b0.pt':\n",
" for d in 'mnist', 'fashion-mnist', 'cifar10', 'cifar100', 'imagenette160', 'imagenette320', 'imagenette', 'imagewoof160', 'imagewoof320', 'imagewoof':\n",
" !python classify/train.py --model {m} --data {d} --epochs 10 --project YOLOv5-cls --name {m}-{d}"
],
"metadata": {
"id": "UWGH7H6yakVl"
},
"execution_count": null,
"outputs": []
},