Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yolov5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
yolov5
Commits
62d77a10
提交
62d77a10
authored
11月 03, 2021
作者:
Glenn Jocher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Created using Colaboratory
上级
84a8099b
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
198 行增加
和
127 行删除
+198
-127
tutorial.ipynb
tutorial.ipynb
+198
-127
没有找到文件。
tutorial.ipynb
浏览文件 @
62d77a10
...
...
@@ -15,7 +15,7 @@
"accelerator": "GPU",
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"
484511f272e64eab8b42e68dac5f7a66
": {
"
eb95db7cae194218b3fcefb439b6352f
": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
...
...
@@ -28,16 +28,16 @@
"_view_count": null,
"_view_module_version": "1.5.0",
"box_style": "",
"layout": "IPY_MODEL_7
8cceec059784f2bb36988d3336e4d56
",
"layout": "IPY_MODEL_7
69ecde6f2e64bacb596ce972f8d3d2d
",
"_model_module": "@jupyter-widgets/controls",
"children": [
"IPY_MODEL_
ab93d8b65c134605934ff9ec5efb1bb6
",
"IPY_MODEL_
30df865ded4c434191bce772c9a82f3a
",
"IPY_MODEL_
20cdc61eb3404f42a12b37901b0d85fb
"
"IPY_MODEL_
384a001876054c93b0af45cd1e960bfe
",
"IPY_MODEL_
dded0aeae74440f7ba2ffa0beb8dd612
",
"IPY_MODEL_
5296d28be75740b2892ae421bbec3657
"
]
}
},
"7
8cceec059784f2bb36988d3336e4d56
": {
"7
69ecde6f2e64bacb596ce972f8d3d2d
": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
...
...
@@ -89,13 +89,13 @@
"left": null
}
},
"
ab93d8b65c134605934ff9ec5efb1bb6
": {
"
384a001876054c93b0af45cd1e960bfe
": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_
2d7239993a9645b09b221405ac682743
",
"style": "IPY_MODEL_
9f09facb2a6c4a7096810d327c8b551c
",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
...
...
@@ -107,16 +107,16 @@
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_
17b5a87f92104ec7ab96bf507637d0d2
"
"layout": "IPY_MODEL_
25621cff5d16448cb7260e839fd0f543
"
}
},
"
30df865ded4c434191bce772c9a82f3a
": {
"
dded0aeae74440f7ba2ffa0beb8dd612
": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_
2358bfb2270247359e94b066b3cc3d1f
",
"style": "IPY_MODEL_
0ce7164fc0c74bb9a2b5c7037375a727
",
"_dom_classes": [],
"description": "",
"_model_name": "FloatProgressModel",
...
...
@@ -131,31 +131,31 @@
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_
3e984405db654b0b83b88b2db08baffd
"
"layout": "IPY_MODEL_
c4c4593c10904cb5b8a5724d60c7e181
"
}
},
"
20cdc61eb3404f42a12b37901b0d85fb
": {
"
5296d28be75740b2892ae421bbec3657
": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_
654d8a19b9f949c6bbdaf8b0875c931e
",
"style": "IPY_MODEL_
473371611126476c88d5d42ec7031ed6
",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": " 780M/780M [00:
33<00:00, 24.4
MB/s]",
"value": " 780M/780M [00:
11<00:00, 91.9
MB/s]",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_
896030c5d13b415aaa05032818d81a6e
"
"layout": "IPY_MODEL_
65efdfd0d26c46e79c8c5ff3b77126cc
"
}
},
"
2d7239993a9645b09b221405ac682743
": {
"
9f09facb2a6c4a7096810d327c8b551c
": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
...
...
@@ -170,7 +170,7 @@
"_model_module": "@jupyter-widgets/controls"
}
},
"
17b5a87f92104ec7ab96bf507637d0d2
": {
"
25621cff5d16448cb7260e839fd0f543
": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
...
...
@@ -222,7 +222,7 @@
"left": null
}
},
"
2358bfb2270247359e94b066b3cc3d1f
": {
"
0ce7164fc0c74bb9a2b5c7037375a727
": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
...
...
@@ -238,7 +238,7 @@
"_model_module": "@jupyter-widgets/controls"
}
},
"
3e984405db654b0b83b88b2db08baffd
": {
"
c4c4593c10904cb5b8a5724d60c7e181
": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
...
...
@@ -290,7 +290,7 @@
"left": null
}
},
"
654d8a19b9f949c6bbdaf8b0875c931e
": {
"
473371611126476c88d5d42ec7031ed6
": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
...
...
@@ -305,7 +305,7 @@
"_model_module": "@jupyter-widgets/controls"
}
},
"
896030c5d13b415aaa05032818d81a6e
": {
"
65efdfd0d26c46e79c8c5ff3b77126cc
": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
...
...
@@ -402,7 +402,7 @@
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "
4d67116a-43e9-4d84-d19e-1edd83f23a04
"
"outputId": "
e2e839d5-d6fc-409c-e44c-0b0b6aa9319d
"
},
"source": [
"!git clone https://github.com/ultralytics/yolov5 # clone repo\n",
...
...
@@ -415,14 +415,14 @@
"clear_output()\n",
"print(f\"Setup complete. Using torch {torch.__version__} ({torch.cuda.get_device_properties(0).name if torch.cuda.is_available() else 'CPU'})\")"
],
"execution_count":
null
,
"execution_count":
11
,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Setup complete. Using torch 1.9.0+cu102 (Tesla V100-SXM2-16GB)\n"
],
"name": "stdout"
"Setup complete. Using torch 1.10.0+cu102 (Tesla V100-SXM2-16GB)\n"
]
}
]
},
...
...
@@ -454,28 +454,28 @@
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "8
b728908-81ab-4861-edb0-4d0c46c439fb
"
"outputId": "8
f7e6588-215d-4ebd-93af-88b871e770a7
"
},
"source": [
"!python detect.py --weights yolov5s.pt --img 640 --conf 0.25 --source data/images
/
\n",
"!python detect.py --weights yolov5s.pt --img 640 --conf 0.25 --source data/images\n",
"Image(filename='runs/detect/exp/zidane.jpg', width=600)"
],
"execution_count":
null
,
"execution_count":
17
,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\u001b[34m\u001b[1mdetect: \u001b[0mweights=['yolov5s.pt'], source=data/images
/, imgsz=640, conf_thres=0.25, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs/detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half
=False\n",
"YOLOv5 🚀 v
5.0-367-g01cdb76 torch 1.9.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5M
B)\n",
"\u001b[34m\u001b[1mdetect: \u001b[0mweights=['yolov5s.pt'], source=data/images
, imgsz=[640, 640], conf_thres=0.25, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs/detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn
=False\n",
"YOLOv5 🚀 v
6.0-48-g84a8099 torch 1.10.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160Mi
B)\n",
"\n",
"Fusing layers... \n",
"Model Summary: 224 layers, 7266973 parameters, 0 gradients\n",
"image 1/2 /content/yolov5/data/images/bus.jpg: 640x480 4 persons, 1 bus, 1 fire hydrant, Done. (0.007s)\n",
"image 2/2 /content/yolov5/data/images/zidane.jpg: 384x640 2 persons, 2 ties, Done. (0.007s)\n",
"Results saved to \u001b[1mruns/detect/exp\u001b[0m\n",
"Done. (0.091s)\n"
],
"name": "stdout"
"Model Summary: 213 layers, 7225885 parameters, 0 gradients\n",
"image 1/2 /content/yolov5/data/images/bus.jpg: 640x480 4 persons, 1 bus, Done. (0.007s)\n",
"image 2/2 /content/yolov5/data/images/zidane.jpg: 384x640 2 persons, 1 tie, Done. (0.007s)\n",
"Speed: 0.5ms pre-process, 6.9ms inference, 1.3ms NMS per image at shape (1, 3, 640, 640)\n",
"Results saved to \u001b[1mruns/detect/exp\u001b[0m\n"
]
}
]
},
...
...
@@ -517,33 +517,33 @@
"base_uri": "https://localhost:8080/",
"height": 48,
"referenced_widgets": [
"
484511f272e64eab8b42e68dac5f7a66
",
"7
8cceec059784f2bb36988d3336e4d56
",
"
ab93d8b65c134605934ff9ec5efb1bb6
",
"
30df865ded4c434191bce772c9a82f3a
",
"
20cdc61eb3404f42a12b37901b0d85fb
",
"
2d7239993a9645b09b221405ac682743
",
"
17b5a87f92104ec7ab96bf507637d0d2
",
"
2358bfb2270247359e94b066b3cc3d1f
",
"
3e984405db654b0b83b88b2db08baffd
",
"
654d8a19b9f949c6bbdaf8b0875c931e
",
"
896030c5d13b415aaa05032818d81a6e
"
"
eb95db7cae194218b3fcefb439b6352f
",
"7
69ecde6f2e64bacb596ce972f8d3d2d
",
"
384a001876054c93b0af45cd1e960bfe
",
"
dded0aeae74440f7ba2ffa0beb8dd612
",
"
5296d28be75740b2892ae421bbec3657
",
"
9f09facb2a6c4a7096810d327c8b551c
",
"
25621cff5d16448cb7260e839fd0f543
",
"
0ce7164fc0c74bb9a2b5c7037375a727
",
"
c4c4593c10904cb5b8a5724d60c7e181
",
"
473371611126476c88d5d42ec7031ed6
",
"
65efdfd0d26c46e79c8c5ff3b77126cc
"
]
},
"outputId": "
7e6f5c96-c819-43e1-cd03-d3b9878cf8de
"
"outputId": "
bcf9a448-1f9b-4a41-ad49-12f181faf05a
"
},
"source": [
"# Download COCO val\n",
"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":
null
,
"execution_count":
18
,
"outputs": [
{
"output_type": "display_data",
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
484511f272e64eab8b42e68dac5f7a66
",
"model_id": "
eb95db7cae194218b3fcefb439b6352f
",
"version_minor": 0,
"version_major": 2
},
...
...
@@ -551,9 +551,7 @@
" 0%| | 0.00/780M [00:00<?, ?B/s]"
]
},
"metadata": {
"tags": []
}
"metadata": {}
}
]
},
...
...
@@ -564,30 +562,31 @@
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "
3dd0e2fc-aecf-4108-91b1-6392da1863cb
"
"outputId": "
74f1dfa9-6b6d-4b36-f67e-bbae243869f9
"
},
"source": [
"# Run YOLOv5x on COCO val\n",
"!python val.py --weights yolov5x.pt --data coco.yaml --img 640 --iou 0.65 --half"
],
"execution_count":
null
,
"execution_count":
19
,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\u001b[34m\u001b[1mval: \u001b[0mdata=
.
/data/coco.yaml, weights=['yolov5x.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.65, task=val, device=, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=True, project=runs/val, name=exp, exist_ok=False, half=True\n",
"YOLOv5 🚀 v
5.0-367-g01cdb76 torch 1.9.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5M
B)\n",
"\u001b[34m\u001b[1mval: \u001b[0mdata=
/content/yolov5
/data/coco.yaml, weights=['yolov5x.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.65, task=val, device=, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=True, project=runs/val, name=exp, exist_ok=False, half=True\n",
"YOLOv5 🚀 v
6.0-48-g84a8099 torch 1.10.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160Mi
B)\n",
"\n",
"Downloading https://github.com/ultralytics/yolov5/releases/download/v
5
.0/yolov5x.pt to yolov5x.pt...\n",
"100% 16
8M/168M [00:08<00:00, 20.6
MB/s]\n",
"Downloading https://github.com/ultralytics/yolov5/releases/download/v
6
.0/yolov5x.pt to yolov5x.pt...\n",
"100% 16
6M/166M [00:03<00:00, 54.1
MB/s]\n",
"\n",
"Fusing layers... \n",
"Model Summary: 4
76 layers, 8773028
5 parameters, 0 gradients\n",
"\u001b[34m\u001b[1mval: \u001b[0mScanning '../datasets/coco/val2017' images and labels...4952 found, 48 missing, 0 empty, 0 corrupted: 100% 5000/5000 [00:01<00:00, 2
749.96
it/s]\n",
"Model Summary: 4
44 layers, 8670500
5 parameters, 0 gradients\n",
"\u001b[34m\u001b[1mval: \u001b[0mScanning '../datasets/coco/val2017' images and labels...4952 found, 48 missing, 0 empty, 0 corrupted: 100% 5000/5000 [00:01<00:00, 2
636.64
it/s]\n",
"\u001b[34m\u001b[1mval: \u001b[0mNew cache created: ../datasets/coco/val2017.cache\n",
" Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 157/157 [01:
08<00:00, 2.28
it/s]\n",
" all 5000 36335 0.7
46 0.626 0.68 0.49
\n",
"Speed: 0.1ms pre-process,
5.1ms inference, 1.6
ms NMS per image at shape (32, 3, 640, 640)\n",
" Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 157/157 [01:
12<00:00, 2.17
it/s]\n",
" all 5000 36335 0.7
29 0.63 0.683 0.496
\n",
"Speed: 0.1ms pre-process,
4.9ms inference, 1.9
ms NMS per image at shape (32, 3, 640, 640)\n",
"\n",
"Evaluating pycocotools mAP... saving runs/val/exp/yolov5x_predictions.json...\n",
"loading annotations into memory...\n",
...
...
@@ -595,29 +594,28 @@
"creating index...\n",
"index created!\n",
"Loading and preparing results...\n",
"DONE (t=
4.94
s)\n",
"DONE (t=
5.15
s)\n",
"creating index...\n",
"index created!\n",
"Running per image evaluation...\n",
"Evaluate annotation type *bbox*\n",
"DONE (t=
83.60
s).\n",
"DONE (t=
90.39
s).\n",
"Accumulating evaluation results...\n",
"DONE (t=1
3.22
s).\n",
" Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.50
4
\n",
" Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.68
8
\n",
" Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.5
46
\n",
" Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.3
51
\n",
" Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.55
1
\n",
" Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.6
44
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.38
2
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.6
29
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.68
1
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.52
4
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.73
5
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.82
7
\n",
"DONE (t=1
4.54
s).\n",
" Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.50
7
\n",
" Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.68
9
\n",
" Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.5
52
\n",
" Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.3
45
\n",
" Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.55
9
\n",
" Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.6
52
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.38
1
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.6
30
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.68
2
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.52
6
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.73
2
\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.82
9
\n",
"Results saved to \u001b[1mruns/val/exp\u001b[0m\n"
],
"name": "stdout"
]
}
]
},
...
...
@@ -722,37 +720,37 @@
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "
00ea4b14-a75c-44a2-a913-03b431b69de5
"
"outputId": "
8724d13d-6711-4a12-d96a-1c655e5c3549
"
},
"source": [
"# 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":
null
,
"execution_count":
24
,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\u001b[34m\u001b[1mtrain: \u001b[0mweights=yolov5s.pt, cfg=, data=coco128.yaml, hyp=data/hyps/hyp.scratch.yaml, epochs=3, batch_size=16, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, evolve=None, bucket=, cache=ram, image_weights=False, device=, multi_scale=False, single_cls=False, adam=False, sync_bn=False, workers=8, project=runs/train,
entity=None, name=exp, exist_ok=False, quad=False, linear_lr=False, label_smoothing=0.0, upload_dataset=False, bbox_interval=-1, save_period=-1, artifact_alias=latest, local_rank=-1, freeze=0
\n",
"\u001b[34m\u001b[1mtrain: \u001b[0mweights=yolov5s.pt, cfg=, data=coco128.yaml, hyp=data/hyps/hyp.scratch.yaml, epochs=3, batch_size=16, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, evolve=None, bucket=, cache=ram, image_weights=False, device=, multi_scale=False, single_cls=False, adam=False, sync_bn=False, workers=8, project=runs/train,
name=exp, exist_ok=False, quad=False, linear_lr=False, label_smoothing=0.0, patience=100, freeze=0, save_period=-1, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest
\n",
"\u001b[34m\u001b[1mgithub: \u001b[0mup to date with https://github.com/ultralytics/yolov5 ✅\n",
"YOLOv5 🚀 v
5.0-367-g01cdb76 torch 1.9.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5M
B)\n",
"YOLOv5 🚀 v
6.0-48-g84a8099 torch 1.10.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160Mi
B)\n",
"\n",
"\u001b[34m\u001b[1mhyperparameters: \u001b[0mlr0=0.01, lrf=0.
2
, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0\n",
"\u001b[34m\u001b[1mhyperparameters: \u001b[0mlr0=0.01, lrf=0.
1
, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0\n",
"\u001b[34m\u001b[1mWeights & Biases: \u001b[0mrun 'pip install wandb' to automatically track and visualize YOLOv5 🚀 runs (RECOMMENDED)\n",
"\u001b[34m\u001b[1mTensorBoard: \u001b[0mStart with 'tensorboard --logdir runs/train', view at http://localhost:6006/\n",
"2021-08-15 14:40:43.449642: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0\n",
"\n",
" from n params module arguments \n",
" 0 -1 1 3520 models.common.
Focus [3, 32, 3]
\n",
" 0 -1 1 3520 models.common.
Conv [3, 32, 6, 2, 2]
\n",
" 1 -1 1 18560 models.common.Conv [32, 64, 3, 2] \n",
" 2 -1 1 18816 models.common.C3 [64, 64, 1] \n",
" 3 -1 1 73984 models.common.Conv [64, 128, 3, 2] \n",
" 4 -1
3 156928 models.common.C3 [128, 128, 3
] \n",
" 4 -1
2 115712 models.common.C3 [128, 128, 2
] \n",
" 5 -1 1 295424 models.common.Conv [128, 256, 3, 2] \n",
" 6 -1 3 625152 models.common.C3 [256, 256, 3] \n",
" 7 -1 1 1180672 models.common.Conv [256, 512, 3, 2] \n",
" 8 -1 1
656896 models.common.SPP [512, 512, [5, 9, 13]]
\n",
" 9 -1 1
1182720 models.common.C3 [512, 512, 1, False]
\n",
" 8 -1 1
1182720 models.common.C3 [512, 512, 1]
\n",
" 9 -1 1
656896 models.common.SPPF [512, 512, 5]
\n",
" 10 -1 1 131584 models.common.Conv [512, 256, 1, 1] \n",
" 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n",
" 12 [-1, 6] 1 0 models.common.Concat [1] \n",
...
...
@@ -768,48 +766,121 @@
" 22 [-1, 10] 1 0 models.common.Concat [1] \n",
" 23 -1 1 1182720 models.common.C3 [512, 512, 1, False] \n",
" 24 [17, 20, 23] 1 229245 models.yolo.Detect [80, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]]\n",
"Model Summary: 2
83 layers, 7276605 parameters, 7276605 gradients, 17.1
GFLOPs\n",
"Model Summary: 2
70 layers, 7235389 parameters, 7235389 gradients, 16.5
GFLOPs\n",
"\n",
"Transferred 3
62/362
items from yolov5s.pt\n",
"Transferred 3
49/349
items from yolov5s.pt\n",
"Scaled weight_decay = 0.0005\n",
"\u001b[34m\u001b[1moptimizer:\u001b[0m SGD with parameter groups 5
9 weight, 62 weight (no decay), 62
bias\n",
"\u001b[34m\u001b[1moptimizer:\u001b[0m SGD with parameter groups 5
7 weight, 60 weight (no decay), 60
bias\n",
"\u001b[34m\u001b[1malbumentations: \u001b[0mversion 1.0.3 required by YOLOv5, but version 0.1.12 is currently installed\n",
"\u001b[34m\u001b[1mtrain: \u001b[0mScanning '../datasets/coco128/labels/train2017' images and labels...128 found, 0 missing, 2 empty, 0 corrupted: 100% 128/128 [00:00<00:00, 2440.28it/s]\n",
"\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: ../datasets/coco128/labels/train2017.cache\n",
"\u001b[34m\u001b[1mtrain: \u001b[0mCaching images (0.1GB ram): 100% 128/128 [00:00<00:00, 302.61it/s]\n",
"\u001b[34m\u001b[1mtrain: \u001b[0mScanning '../datasets/coco128/labels/train2017.cache' images and labels... 128 found, 0 missing, 2 empty, 0 corrupted: 100% 128/128 [00:00<?, ?it/s]\n",
"\u001b[34m\u001b[1mtrain: \u001b[0mCaching images (0.1GB ram): 100% 128/128 [00:00<00:00, 296.04it/s]\n",
"\u001b[34m\u001b[1mval: \u001b[0mScanning '../datasets/coco128/labels/train2017.cache' images and labels... 128 found, 0 missing, 2 empty, 0 corrupted: 100% 128/128 [00:00<?, ?it/s]\n",
"\u001b[34m\u001b[1mval: \u001b[0mCaching images (0.1GB ram): 100% 128/128 [00:00<00:00, 142.55it/s]\n",
"[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)\n",
"[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)\n",
"\u001b[34m\u001b[1mval: \u001b[0mCaching images (0.1GB ram): 100% 128/128 [00:01<00:00, 121.58it/s]\n",
"Plotting labels... \n",
"\n",
"\u001b[34m\u001b[1mautoanchor: \u001b[0mAnalyzing anchors... anchors/target = 4.27, Best Possible Recall (BPR) = 0.9935\n",
"Image sizes 640 train, 640 val\n",
"Using 2 dataloader workers\n",
"Logging results to
runs/train/exp
\n",
"Logging results to
\u001b[1mruns/train/exp\u001b[0m
\n",
"Starting training for 3 epochs...\n",
"\n",
" Epoch gpu_mem box obj cls labels img_size\n",
" 0/2 3.6
4G 0.04492 0.0674 0.02213 298 640: 100% 8/8 [00:03<00:00, 2.05
it/s]\n",
" Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:00<00:00, 4.
70
it/s]\n",
" all 128 929 0.6
86 0.565 0.642 0.42
1\n",
" 0/2 3.6
2G 0.04621 0.0711 0.02112 203 640: 100% 8/8 [00:04<00:00, 1.99
it/s]\n",
" Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:00<00:00, 4.
37
it/s]\n",
" all 128 929 0.6
55 0.547 0.622 0.4
1\n",
"\n",
" Epoch gpu_mem box obj cls labels img_size\n",
" 1/2 5.
04G 0.04403 0.0611 0.01986 232 640: 100% 8/8 [00:01<00:00, 5.59
it/s]\n",
" Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:00<00:00, 4.
46
it/s]\n",
" all 128 929
0.694 0.563 0.654 0.425
\n",
" 1/2 5.
31G 0.04564 0.06898 0.02116 143 640: 100% 8/8 [00:01<00:00, 4.77
it/s]\n",
" Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:00<00:00, 4.
27
it/s]\n",
" all 128 929
0.68 0.554 0.632 0.419
\n",
"\n",
" Epoch gpu_mem box obj cls labels img_size\n",
" 2/2 5.04G 0.04616 0.07056 0.02071 214 640: 100% 8/8 [00:01<00:00, 5.94it/s]\n",
" Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.52it/s]\n",
" all 128 929 0.711 0.562 0.66 0.431\n",
" 2/2 5.31G 0.04487 0.06883 0.01998 253 640: 100% 8/8 [00:01<00:00, 4.91it/s]\n",
" Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:00<00:00, 4.30it/s]\n",
" all 128 929 0.71 0.544 0.629 0.423\n",
"\n",
"3 epochs completed in 0.003 hours.\n",
"Optimizer stripped from runs/train/exp/weights/last.pt, 14.9MB\n",
"Optimizer stripped from runs/train/exp/weights/best.pt, 14.9MB\n",
"\n",
"3 epochs completed in 0.005 hours.\n",
"Optimizer stripped from runs/train/exp/weights/last.pt, 14.8MB\n",
"Optimizer stripped from runs/train/exp/weights/best.pt, 14.8MB\n",
"Validating runs/train/exp/weights/best.pt...\n",
"Fusing layers... \n",
"Model Summary: 213 layers, 7225885 parameters, 0 gradients, 16.5 GFLOPs\n",
" Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.04it/s]\n",
" all 128 929 0.71 0.544 0.63 0.423\n",
" person 128 254 0.816 0.669 0.774 0.507\n",
" bicycle 128 6 0.799 0.667 0.614 0.371\n",
" car 128 46 0.803 0.355 0.486 0.209\n",
" motorcycle 128 5 0.704 0.6 0.791 0.583\n",
" airplane 128 6 1 0.795 0.995 0.717\n",
" bus 128 7 0.656 0.714 0.72 0.606\n",
" train 128 3 0.852 1 0.995 0.682\n",
" truck 128 12 0.521 0.25 0.395 0.215\n",
" boat 128 6 0.795 0.333 0.445 0.137\n",
" traffic light 128 14 0.576 0.143 0.24 0.161\n",
" stop sign 128 2 0.636 0.5 0.828 0.713\n",
" bench 128 9 0.972 0.444 0.575 0.25\n",
" bird 128 16 0.939 0.968 0.988 0.645\n",
" cat 128 4 0.984 0.75 0.822 0.694\n",
" dog 128 9 0.888 0.667 0.903 0.54\n",
" horse 128 2 0.689 1 0.995 0.697\n",
" elephant 128 17 0.96 0.882 0.943 0.681\n",
" bear 128 1 0.549 1 0.995 0.995\n",
" zebra 128 4 0.86 1 0.995 0.952\n",
" giraffe 128 9 0.822 0.778 0.905 0.57\n",
" backpack 128 6 1 0.309 0.457 0.195\n",
" umbrella 128 18 0.775 0.576 0.74 0.418\n",
" handbag 128 19 0.628 0.105 0.167 0.111\n",
" tie 128 7 0.96 0.571 0.701 0.441\n",
" suitcase 128 4 1 0.895 0.995 0.621\n",
" frisbee 128 5 0.641 0.8 0.798 0.664\n",
" skis 128 1 0.627 1 0.995 0.497\n",
" snowboard 128 7 0.988 0.714 0.768 0.556\n",
" sports ball 128 6 0.671 0.5 0.579 0.339\n",
" kite 128 10 0.631 0.515 0.598 0.221\n",
" baseball bat 128 4 0.47 0.456 0.277 0.137\n",
" baseball glove 128 7 0.459 0.429 0.334 0.182\n",
" skateboard 128 5 0.7 0.48 0.736 0.548\n",
" tennis racket 128 7 0.559 0.571 0.538 0.315\n",
" bottle 128 18 0.607 0.389 0.484 0.282\n",
" wine glass 128 16 0.722 0.812 0.82 0.385\n",
" cup 128 36 0.881 0.361 0.532 0.312\n",
" fork 128 6 0.384 0.167 0.239 0.191\n",
" knife 128 16 0.908 0.616 0.681 0.443\n",
" spoon 128 22 0.836 0.364 0.536 0.264\n",
" bowl 128 28 0.793 0.536 0.633 0.471\n",
" banana 128 1 0 0 0.142 0.0995\n",
" sandwich 128 2 0 0 0.0951 0.0717\n",
" orange 128 4 1 0 0.67 0.317\n",
" broccoli 128 11 0.345 0.182 0.283 0.243\n",
" carrot 128 24 0.688 0.459 0.612 0.402\n",
" hot dog 128 2 0.424 0.771 0.497 0.473\n",
" pizza 128 5 0.622 1 0.824 0.551\n",
" donut 128 14 0.703 1 0.952 0.853\n",
" cake 128 4 0.733 1 0.945 0.777\n",
" chair 128 35 0.512 0.486 0.488 0.222\n",
" couch 128 6 0.68 0.36 0.746 0.406\n",
" potted plant 128 14 0.797 0.714 0.808 0.482\n",
" bed 128 3 1 0 0.474 0.318\n",
" dining table 128 13 0.852 0.445 0.478 0.315\n",
" toilet 128 2 0.512 0.5 0.554 0.487\n",
" tv 128 2 0.754 1 0.995 0.895\n",
" laptop 128 3 1 0 0.39 0.147\n",
" mouse 128 2 1 0 0.0283 0.0226\n",
" remote 128 8 0.747 0.625 0.636 0.488\n",
" cell phone 128 8 0.555 0.166 0.417 0.222\n",
" microwave 128 3 0.417 1 0.995 0.732\n",
" oven 128 5 0.37 0.4 0.432 0.249\n",
" sink 128 6 0.356 0.167 0.269 0.149\n",
" refrigerator 128 5 0.705 0.8 0.814 0.45\n",
" book 128 29 0.628 0.138 0.298 0.136\n",
" clock 128 9 0.857 0.778 0.893 0.574\n",
" vase 128 2 0.242 1 0.663 0.622\n",
" scissors 128 1 1 0 0.0207 0.00207\n",
" teddy bear 128 21 0.847 0.381 0.622 0.345\n",
" toothbrush 128 5 0.99 0.6 0.662 0.45\n",
"Results saved to \u001b[1mruns/train/exp\u001b[0m\n"
],
"name": "stdout"
]
}
]
},
...
...
@@ -953,19 +1024,19 @@
"%%shell\n",
"export PYTHONPATH=\"$PWD\" # to run *.py. files in subdirectories\n",
"rm -rf runs # remove runs/\n",
"for m in yolov5
s
; do # models\n",
" python train.py --
weights $m.pt --epochs 3 --img 320
--device 0 # train pretrained\n",
" python train.py --
weights '' --cfg $m.yaml --epochs 3 --img 320
--device 0 # train scratch\n",
"for m in yolov5
n
; 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 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",
" 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",
" 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 128
--batch 1 --weights $m.pt --include torchscript onnx # export\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"
],
"execution_count": null,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论