Skip to content

Commit

Permalink
Update Colab Notebook CI (ultralytics#8798)
Browse files Browse the repository at this point in the history
* Update Colab Notebook CI

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Created using Colaboratory

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update tutorial.ipynb

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and Clay Januhowski committed Sep 8, 2022
1 parent 162f652 commit 60f933f
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions tutorial.ipynb
Original file line number Diff line number Diff line change
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

0 comments on commit 60f933f

Please sign in to comment.