Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Colab Notebook CI #8798

Merged
merged 6 commits into from
Jul 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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