Increment train, test, detect runs/ (#1322)

* Increment train, test, detect runs/

* Update ci-testing.yml

* inference/images to data/images

* move images

* runs/exp to runs/train/exp

* update 'results saved to %s' str
This commit is contained in:
Glenn Jocher authored and GitHub committed 2020-11-08 19:39:05 +01:00
1 parent d3e7778151
commit 4821d076e2
13 files changed
+76 -382

No files matched your search

+18 -18
View File
@@ -596,22 +596,22 @@
}
},
"source": [
"!python detect.py --weights yolov5s.pt --img 640 --conf 0.25 --source inference/images/\n",
"Image(filename='inference/output/zidane.jpg', width=600)"
"!python detect.py --weights yolov5s.pt --img 640 --conf 0.25 --source data/images/\n",
"Image(filename='runs/detect/exp0/zidane.jpg', width=600)"
],
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"text": [
"Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.25, device='', img_size=640, iou_thres=0.45, save_conf=False, save_dir='inference/output', save_txt=False, source='inference/images/', update=False, view_img=False, weights=['yolov5s.pt'])\n",
"Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.25, device='', img_size=640, iou_thres=0.45, save_conf=False, save_dir='runs/detect', save_txt=False, source='data/images/', update=False, view_img=False, weights=['yolov5s.pt'])\n",
"Using CUDA device0 _CudaDeviceProperties(name='Tesla V100-SXM2-16GB', total_memory=16130MB)\n",
"\n",
"Fusing layers... \n",
"Model Summary: 140 layers, 7.45958e+06 parameters, 0 gradients\n",
"image 1/2 /content/yolov5/inference/images/bus.jpg: 640x480 4 persons, 1 buss, 1 skateboards, Done. (0.012s)\n",
"image 2/2 /content/yolov5/inference/images/zidane.jpg: 384x640 2 persons, 2 ties, Done. (0.012s)\n",
"Results saved to inference/output\n",
"image 1/2 /content/yolov5/data/images/bus.jpg: 640x480 4 persons, 1 buss, 1 skateboards, Done. (0.012s)\n",
"image 2/2 /content/yolov5/data/images/zidane.jpg: 384x640 2 persons, 2 ties, Done. (0.012s)\n",
"Results saved to runs/detect/exp0\n",
"Done. (0.113s)\n"
],
"name": "stdout"
@@ -640,7 +640,7 @@
"id": "4qbaa3iEcrcE"
},
"source": [
"Results are saved to `inference/output`. A full list of available inference sources:\n",
"Results are saved to `runs/detect`. A full list of available inference sources:\n",
"<img src=\"https://user-images.githubusercontent.com/26833433/98274798-2b7a7a80-1f94-11eb-91a4-70c73593e26b.jpg\" width=\"900\"> "
]
},
@@ -887,7 +887,7 @@
"source": [
"Train a YOLOv5s model on [COCO128](https://www.kaggle.com/ultralytics/coco128) with dataset `--data coco128.yaml`, starting from pretrained `--weights yolov5s.pt`, or from randomly initialized `--weights '' --cfg yolov5s.yaml`. Models are downloaded automatically from the [latest YOLOv5 release](https://github.com/ultralytics/yolov5/releases), and **COCO, COCO128, and VOC datasets are downloaded automatically** on first use.\n",
"\n",
"All training results are saved to `runs/exp0` for the first experiment, then `runs/exp1`, `runs/exp2` etc. for subsequent experiments.\n"
"All training results are saved to `runs/train/exp0` for the first experiment, then `runs/exp1`, `runs/exp2` etc. for subsequent experiments.\n"
]
},
{
@@ -969,7 +969,7 @@
"Analyzing anchors... anchors/target = 4.26, Best Possible Recall (BPR) = 0.9946\n",
"Image sizes 640 train, 640 test\n",
"Using 2 dataloader workers\n",
"Logging results to runs/exp0\n",
"Logging results to runs/train/exp0\n",
"Starting training for 3 epochs...\n",
"\n",
" Epoch gpu_mem box obj cls total targets img_size\n",
@@ -986,8 +986,8 @@
" 2/2 3.17G 0.04445 0.06545 0.01666 0.1266 149 640: 100% 8/8 [00:01<00:00, 4.33it/s]\n",
" Class Images Targets P R mAP@.5 mAP@.5:.95: 100% 8/8 [00:02<00:00, 2.78it/s]\n",
" all 128 929 0.395 0.766 0.701 0.455\n",
"Optimizer stripped from runs/exp0/weights/last.pt, 15.2MB\n",
"Optimizer stripped from runs/exp0/weights/best.pt, 15.2MB\n",
"Optimizer stripped from runs/train/exp0/weights/last.pt, 15.2MB\n",
"Optimizer stripped from runs/train/exp0/weights/best.pt, 15.2MB\n",
"3 epochs completed in 0.005 hours.\n",
"\n"
],
@@ -1030,7 +1030,7 @@
"source": [
"## Local Logging\n",
"\n",
"All results are logged by default to the `runs/exp0` directory, with a new directory created for each new training as `runs/exp1`, `runs/exp2`, etc. View train and test jpgs to see mosaics, labels/predictions and augmentation effects. Note a **Mosaic Dataloader** is used for training (shown below), a new concept developed by Ultralytics and first featured in [YOLOv4](https://arxiv.org/abs/2004.10934)."
"All results are logged by default to the `runs/train/exp0` directory, with a new directory created for each new training as `runs/exp1`, `runs/exp2`, etc. View train and test jpgs to see mosaics, labels/predictions and augmentation effects. Note a **Mosaic Dataloader** is used for training (shown below), a new concept developed by Ultralytics and first featured in [YOLOv4](https://arxiv.org/abs/2004.10934)."
]
},
{
@@ -1039,9 +1039,9 @@
"id": "riPdhraOTCO0"
},
"source": [
"Image(filename='runs/exp0/train_batch0.jpg', width=800) # train batch 0 mosaics and labels\n",
"Image(filename='runs/exp0/test_batch0_gt.jpg', width=800) # test batch 0 ground truth\n",
"Image(filename='runs/exp0/test_batch0_pred.jpg', width=800) # test batch 0 predictions"
"Image(filename='runs/train/exp0/train_batch0.jpg', width=800) # train batch 0 mosaics and labels\n",
"Image(filename='runs/train/exp0/test_batch0_gt.jpg', width=800) # test batch 0 ground truth\n",
"Image(filename='runs/train/exp0/test_batch0_pred.jpg', width=800) # test batch 0 predictions"
],
"execution_count": null,
"outputs": []
@@ -1078,7 +1078,7 @@
},
"source": [
"from utils.utils import plot_results \n",
"plot_results(save_dir='runs/exp0') # plot results.txt as results.png\n",
"plot_results(save_dir='runs/train/exp0') # plot results.txt as results.png\n",
"Image(filename='results.png', width=800) "
],
"execution_count": null,
@@ -1170,9 +1170,9 @@
" for di in 0 cpu # inference devices\n",
" do\n",
" python detect.py --weights $x.pt --device $di # detect official\n",
" python detect.py --weights runs/exp0/weights/last.pt --device $di # detect custom\n",
" python detect.py --weights runs/train/exp0/weights/last.pt --device $di # detect custom\n",
" python test.py --weights $x.pt --device $di # test official\n",
" python test.py --weights runs/exp0/weights/last.pt --device $di # test custom\n",
" python test.py --weights runs/train/exp0/weights/last.pt --device $di # test custom\n",
" done\n",
" python models/yolo.py --cfg $x.yaml # inspect\n",
" python models/export.py --weights $x.pt --img 640 --batch 1 # export\n",