Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jul 30, 2022
1 parent 86c5b99 commit a7a28f1
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/ultralytics/yolov5/blob/glenn-jocher-patch-2/tutorial.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
Expand Down Expand Up @@ -414,7 +414,7 @@
"import utils\n",
"display = utils.notebook_init() # checks"
],
"execution_count": 1,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -466,7 +466,7 @@
"!python detect.py --weights yolov5s.pt --img 640 --conf 0.25 --source data/images\n",
"display.Image(filename='runs/detect/exp/zidane.jpg', width=600)"
],
"execution_count": 2,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -546,7 +546,7 @@
"torch.hub.download_url_to_file('https://ultralytics.com/assets/coco2017val.zip', 'tmp.zip')\n",
"!unzip -q tmp.zip -d ../datasets && rm tmp.zip"
],
"execution_count": 3,
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -577,7 +577,7 @@
"# Run YOLOv5x on COCO val\n",
"!python val.py --weights yolov5x.pt --data coco.yaml --img 640 --iou 0.65 --half"
],
"execution_count": 4,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -737,7 +737,7 @@
"# Train YOLOv5s on COCO128 for 3 epochs\n",
"!python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache"
],
"execution_count": 7,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -1032,24 +1032,22 @@
"id": "FGH0ZjkGjejy"
},
"source": [
"# CI Checks\n",
"# YOLOv5 CI\n",
"%%shell\n",
"export PYTHONPATH=\"$PWD\" # to run *.py. files in subdirectories\n",
"rm -rf runs # remove runs/\n",
"for m in yolov5n; do # models\n",
" python train.py --img 64 --batch 32 --weights $m.pt --epochs 1 --device 0 # train pretrained\n",
" python train.py --img 64 --batch 32 --weights '' --cfg $m.yaml --epochs 1 --device 0 # train scratch\n",
" for d in 0 cpu; do # devices\n",
" python val.py --weights $m.pt --device $d # val official\n",
" python val.py --weights runs/train/exp/weights/best.pt --device $d # val custom\n",
" python detect.py --weights $m.pt --device $d # detect official\n",
" python detect.py --weights runs/train/exp/weights/best.pt --device $d # detect custom\n",
"m=yolov5n # official weights\n",
"b=runs/train/exp/weights/best # best.pt checkpoint\n",
"python train.py --imgsz 64 --batch 32 --weights $m.pt --cfg $m.yaml --epochs 1 --device 0 # train\n",
"for d in 0 cpu; do # devices\n",
" for w in $m $b; do # weights\n",
" python val.py --imgsz 64 --batch 32 --weights $w.pt --device $d # val\n",
" python detect.py --imgsz 64 --weights $w.pt --device $d # detect\n",
" done\n",
" python hubconf.py # hub\n",
" python models/yolo.py --cfg $m.yaml # build PyTorch model\n",
" python models/tf.py --weights $m.pt # build TensorFlow model\n",
" python export.py --img 64 --batch 1 --weights $m.pt --include torchscript onnx # export\n",
"done"
"done\n",
"python hubconf.py --model $m # hub\n",
"python models/tf.py --weights $m.pt # build TF model\n",
"python models/yolo.py --cfg $m.yaml # build PyTorch model\n",
"python export.py --weights $m.pt --img 64 --include torchscript # export"
],
"execution_count": null,
"outputs": []
Expand Down Expand Up @@ -1112,4 +1110,4 @@
"outputs": []
}
]
}
}

0 comments on commit a7a28f1

Please sign in to comment.