Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yolov5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
yolov5
Commits
4e65052f
提交
4e65052f
authored
8月 15, 2021
作者:
Glenn Jocher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Created using Colaboratory
上级
01cdb767
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
106 行增加
和
318 行删除
+106
-318
tutorial.ipynb
tutorial.ipynb
+106
-318
没有找到文件。
tutorial.ipynb
浏览文件 @
4e65052f
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
"name": "YOLOv5 Tutorial",
"name": "YOLOv5 Tutorial",
"provenance": [],
"provenance": [],
"collapsed_sections": [],
"collapsed_sections": [],
"toc_visible": true,
"include_colab_link": true
"include_colab_link": true
},
},
"kernelspec": {
"kernelspec": {
...
@@ -16,7 +15,7 @@
...
@@ -16,7 +15,7 @@
"accelerator": "GPU",
"accelerator": "GPU",
"widgets": {
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"application/vnd.jupyter.widget-state+json": {
"
2e915d9016c846e095e382b6a02ee773
": {
"
484511f272e64eab8b42e68dac5f7a66
": {
"model_module": "@jupyter-widgets/controls",
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"model_module_version": "1.5.0",
...
@@ -29,15 +28,16 @@
...
@@ -29,15 +28,16 @@
"_view_count": null,
"_view_count": null,
"_view_module_version": "1.5.0",
"_view_module_version": "1.5.0",
"box_style": "",
"box_style": "",
"layout": "IPY_MODEL_
cb7fc3a5c6cc4fde8d2c83e594a7c86e
",
"layout": "IPY_MODEL_
78cceec059784f2bb36988d3336e4d56
",
"_model_module": "@jupyter-widgets/controls",
"_model_module": "@jupyter-widgets/controls",
"children": [
"children": [
"IPY_MODEL_ac3edef4e3434f4587e6cbf8aa048770",
"IPY_MODEL_ab93d8b65c134605934ff9ec5efb1bb6",
"IPY_MODEL_853ac234cc2a4236946fc516871e10eb"
"IPY_MODEL_30df865ded4c434191bce772c9a82f3a",
"IPY_MODEL_20cdc61eb3404f42a12b37901b0d85fb"
]
]
}
}
},
},
"
cb7fc3a5c6cc4fde8d2c83e594a7c86e
": {
"
78cceec059784f2bb36988d3336e4d56
": {
"model_module": "@jupyter-widgets/base",
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"model_module_version": "1.2.0",
...
@@ -89,15 +89,36 @@
...
@@ -89,15 +89,36 @@
"left": null
"left": null
}
}
},
},
"ac3edef4e3434f4587e6cbf8aa048770": {
"ab93d8b65c134605934ff9ec5efb1bb6": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_2d7239993a9645b09b221405ac682743",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": "100%",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_17b5a87f92104ec7ab96bf507637d0d2"
}
},
"30df865ded4c434191bce772c9a82f3a": {
"model_module": "@jupyter-widgets/controls",
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"model_module_version": "1.5.0",
"state": {
"state": {
"_view_name": "ProgressView",
"_view_name": "ProgressView",
"style": "IPY_MODEL_
13842ca90c0047e584b8d68d99dad2b1
",
"style": "IPY_MODEL_
2358bfb2270247359e94b066b3cc3d1f
",
"_dom_classes": [],
"_dom_classes": [],
"description": "
100%
",
"description": "",
"_model_name": "FloatProgressModel",
"_model_name": "FloatProgressModel",
"bar_style": "success",
"bar_style": "success",
"max": 818322941,
"max": 818322941,
...
@@ -110,99 +131,31 @@
...
@@ -110,99 +131,31 @@
"min": 0,
"min": 0,
"description_tooltip": null,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_
f454999c3a924c7bad0746fb453dec36
"
"layout": "IPY_MODEL_
3e984405db654b0b83b88b2db08baffd
"
}
}
},
},
"
853ac234cc2a4236946fc516871e10e
b": {
"
20cdc61eb3404f42a12b37901b0d85f
b": {
"model_module": "@jupyter-widgets/controls",
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"model_module_version": "1.5.0",
"state": {
"state": {
"_view_name": "HTMLView",
"_view_name": "HTMLView",
"style": "IPY_MODEL_
f94a7ca8c1f04761bf38fdc5f99664b8
",
"style": "IPY_MODEL_
654d8a19b9f949c6bbdaf8b0875c931e
",
"_dom_classes": [],
"_dom_classes": [],
"description": "",
"description": "",
"_model_name": "HTMLModel",
"_model_name": "HTMLModel",
"placeholder": "",
"placeholder": "",
"_view_module": "@jupyter-widgets/controls",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_module_version": "1.5.0",
"value": " 780M/780M [0
3:59<00:00, 3.42
MB/s]",
"value": " 780M/780M [0
0:33<00:00, 24.4
MB/s]",
"_view_count": null,
"_view_count": null,
"_view_module_version": "1.5.0",
"_view_module_version": "1.5.0",
"description_tooltip": null,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_
9da1a23b042c41618dd14b0e30aa7cb
e"
"layout": "IPY_MODEL_
896030c5d13b415aaa05032818d81a6
e"
}
}
},
},
"13842ca90c0047e584b8d68d99dad2b1": {
"2d7239993a9645b09b221405ac682743": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "initial",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"f454999c3a924c7bad0746fb453dec36": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"f94a7ca8c1f04761bf38fdc5f99664b8": {
"model_module": "@jupyter-widgets/controls",
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"model_module_version": "1.5.0",
...
@@ -217,7 +170,7 @@
...
@@ -217,7 +170,7 @@
"_model_module": "@jupyter-widgets/controls"
"_model_module": "@jupyter-widgets/controls"
}
}
},
},
"
9da1a23b042c41618dd14b0e30aa7cbe
": {
"
17b5a87f92104ec7ab96bf507637d0d2
": {
"model_module": "@jupyter-widgets/base",
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"model_module_version": "1.2.0",
...
@@ -269,132 +222,14 @@
...
@@ -269,132 +222,14 @@
"left": null
"left": null
}
}
},
},
"6ff8a710ded44391a624dec5c460b771": {
"2358bfb2270247359e94b066b3cc3d1f": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HBoxView",
"_dom_classes": [],
"_model_name": "HBoxModel",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.5.0",
"box_style": "",
"layout": "IPY_MODEL_3c19729b51cd45d4848035da06e96ff8",
"_model_module": "@jupyter-widgets/controls",
"children": [
"IPY_MODEL_23b2f0ae3d46438c8de375987c77f580",
"IPY_MODEL_dd9498c321a9422da6faf17a0be026d4"
]
}
},
"3c19729b51cd45d4848035da06e96ff8": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"23b2f0ae3d46438c8de375987c77f580": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_d8dda4b2ce864fd682e558b9a48f602e",
"_dom_classes": [],
"description": "100%",
"_model_name": "FloatProgressModel",
"bar_style": "success",
"max": 6984509,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 6984509,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_ff8151449e444a14869684212b9ab14e"
}
},
"dd9498c321a9422da6faf17a0be026d4": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_0f84fe609bcf4aa9afdc32a8cf076909",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": " 6.66M/6.66M [00:01<00:00, 6.08MB/s]",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_8fda673769984e2b928ef820d34c85c3"
}
},
"d8dda4b2ce864fd682e558b9a48f602e": {
"model_module": "@jupyter-widgets/controls",
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"model_module_version": "1.5.0",
"state": {
"state": {
"_view_name": "StyleView",
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"_model_name": "ProgressStyleModel",
"description_width": "
initial
",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_count": null,
...
@@ -403,7 +238,7 @@
...
@@ -403,7 +238,7 @@
"_model_module": "@jupyter-widgets/controls"
"_model_module": "@jupyter-widgets/controls"
}
}
},
},
"
ff8151449e444a14869684212b9ab14e
": {
"
3e984405db654b0b83b88b2db08baffd
": {
"model_module": "@jupyter-widgets/base",
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"model_module_version": "1.2.0",
...
@@ -455,7 +290,7 @@
...
@@ -455,7 +290,7 @@
"left": null
"left": null
}
}
},
},
"
0f84fe609bcf4aa9afdc32a8cf076909
": {
"
654d8a19b9f949c6bbdaf8b0875c931e
": {
"model_module": "@jupyter-widgets/controls",
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"model_module_version": "1.5.0",
...
@@ -470,7 +305,7 @@
...
@@ -470,7 +305,7 @@
"_model_module": "@jupyter-widgets/controls"
"_model_module": "@jupyter-widgets/controls"
}
}
},
},
"8
fda673769984e2b928ef820d34c85c3
": {
"8
96030c5d13b415aaa05032818d81a6e
": {
"model_module": "@jupyter-widgets/base",
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"model_module_version": "1.2.0",
...
@@ -567,7 +402,7 @@
...
@@ -567,7 +402,7 @@
"colab": {
"colab": {
"base_uri": "https://localhost:8080/"
"base_uri": "https://localhost:8080/"
},
},
"outputId": "
ada1dd8d-e0aa-4858-e893-dc320319ca30
"
"outputId": "
4d67116a-43e9-4d84-d19e-1edd83f23a04
"
},
},
"source": [
"source": [
"!git clone https://github.com/ultralytics/yolov5 # clone repo\n",
"!git clone https://github.com/ultralytics/yolov5 # clone repo\n",
...
@@ -580,7 +415,7 @@
...
@@ -580,7 +415,7 @@
"clear_output()\n",
"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'})\")"
"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":
1
,
"outputs": [
"outputs": [
{
{
"output_type": "stream",
"output_type": "stream",
...
@@ -619,25 +454,26 @@
...
@@ -619,25 +454,26 @@
"colab": {
"colab": {
"base_uri": "https://localhost:8080/"
"base_uri": "https://localhost:8080/"
},
},
"outputId": "
a7a37616-a82b-4bdb-a463-6ead850b5615
"
"outputId": "
8b728908-81ab-4861-edb0-4d0c46c439fb
"
},
},
"source": [
"source": [
"%rm -rf runs\n",
"!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)"
"
#
Image(filename='runs/detect/exp/zidane.jpg', width=600)"
],
],
"execution_count":
null
,
"execution_count":
4
,
"outputs": [
"outputs": [
{
{
"output_type": "stream",
"output_type": "stream",
"text": [
"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",
"\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 🚀 v5.0-3
30-g18f6ba7
torch 1.9.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5MB)\n",
"YOLOv5 🚀 v5.0-3
67-g01cdb76
torch 1.9.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5MB)\n",
"\n",
"\n",
"Fusing layers... \n",
"Fusing layers... \n",
"Model Summary: 224 layers, 7266973 parameters, 0 gradients\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.00
8
s)\n",
"image 1/2 /content/yolov5/data/images/bus.jpg: 640x480 4 persons, 1 bus, 1 fire hydrant, Done. (0.00
7
s)\n",
"image 2/2 /content/yolov5/data/images/zidane.jpg: 384x640 2 persons, 2 ties, Done. (0.00
8
s)\n",
"image 2/2 /content/yolov5/data/images/zidane.jpg: 384x640 2 persons, 2 ties, Done. (0.00
7
s)\n",
"Results saved to
runs/detect/exp
\n",
"Results saved to
\u001b[1mruns/detect/exp\u001b[0m
\n",
"Done. (0.091s)\n"
"Done. (0.091s)\n"
],
],
"name": "stdout"
"name": "stdout"
...
@@ -680,49 +516,45 @@
...
@@ -680,49 +516,45 @@
"id": "WQPtK1QYVaD_",
"id": "WQPtK1QYVaD_",
"colab": {
"colab": {
"base_uri": "https://localhost:8080/",
"base_uri": "https://localhost:8080/",
"height":
66
,
"height":
48
,
"referenced_widgets": [
"referenced_widgets": [
"2e915d9016c846e095e382b6a02ee773",
"484511f272e64eab8b42e68dac5f7a66",
"cb7fc3a5c6cc4fde8d2c83e594a7c86e",
"78cceec059784f2bb36988d3336e4d56",
"ac3edef4e3434f4587e6cbf8aa048770",
"ab93d8b65c134605934ff9ec5efb1bb6",
"853ac234cc2a4236946fc516871e10eb",
"30df865ded4c434191bce772c9a82f3a",
"13842ca90c0047e584b8d68d99dad2b1",
"20cdc61eb3404f42a12b37901b0d85fb",
"f454999c3a924c7bad0746fb453dec36",
"2d7239993a9645b09b221405ac682743",
"f94a7ca8c1f04761bf38fdc5f99664b8",
"17b5a87f92104ec7ab96bf507637d0d2",
"9da1a23b042c41618dd14b0e30aa7cbe"
"2358bfb2270247359e94b066b3cc3d1f",
"3e984405db654b0b83b88b2db08baffd",
"654d8a19b9f949c6bbdaf8b0875c931e",
"896030c5d13b415aaa05032818d81a6e"
]
]
},
},
"outputId": "
3606f305-aa67-43fd-d5d6-93d1f311768c
"
"outputId": "
7e6f5c96-c819-43e1-cd03-d3b9878cf8de
"
},
},
"source": [
"source": [
"# Download COCO val2017\n",
"# Download COCO val2017\n",
"torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/releases/download/v1.0/coco2017val.zip', 'tmp.zip')\n",
"torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/releases/download/v1.0/coco2017val.zip', 'tmp.zip')\n",
"!unzip -q tmp.zip -d ../datasets && rm tmp.zip"
"!unzip -q tmp.zip -d ../datasets && rm tmp.zip"
],
],
"execution_count":
null
,
"execution_count":
5
,
"outputs": [
"outputs": [
{
{
"output_type": "display_data",
"output_type": "display_data",
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
2e915d9016c846e095e382b6a02ee773
",
"model_id": "
484511f272e64eab8b42e68dac5f7a66
",
"version_minor": 0,
"version_minor": 0,
"version_major": 2
"version_major": 2
},
},
"text/plain": [
"text/plain": [
"
HBox(children=(FloatProgress(value=0.0, max=818322941.0), HTML(value='')))
"
"
0%| | 0.00/780M [00:00<?, ?B/s]
"
]
]
},
},
"metadata": {
"metadata": {
"tags": []
"tags": []
}
}
},
{
"output_type": "stream",
"text": [
"\n"
],
"name": "stdout"
}
}
]
]
},
},
...
@@ -733,45 +565,45 @@
...
@@ -733,45 +565,45 @@
"colab": {
"colab": {
"base_uri": "https://localhost:8080/"
"base_uri": "https://localhost:8080/"
},
},
"outputId": "
20fbc423-f536-43ff-e70b-3acf6aeade99
"
"outputId": "
3dd0e2fc-aecf-4108-91b1-6392da1863cb
"
},
},
"source": [
"source": [
"# Run YOLOv5x on COCO val2017\n",
"# Run YOLOv5x on COCO val2017\n",
"!python val.py --weights yolov5x.pt --data coco.yaml --img 640 --iou 0.65 --half"
"!python val.py --weights yolov5x.pt --data coco.yaml --img 640 --iou 0.65 --half"
],
],
"execution_count":
null
,
"execution_count":
6
,
"outputs": [
"outputs": [
{
{
"output_type": "stream",
"output_type": "stream",
"text": [
"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",
"\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 🚀 v5.0-3
30-g18f6ba7
torch 1.9.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5MB)\n",
"YOLOv5 🚀 v5.0-3
67-g01cdb76
torch 1.9.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5MB)\n",
"\n",
"\n",
"Downloading https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5x.pt to yolov5x.pt...\n",
"Downloading https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5x.pt to yolov5x.pt...\n",
"100% 168M/168M [00:0
5<00:00, 31.9
MB/s]\n",
"100% 168M/168M [00:0
8<00:00, 20.6
MB/s]\n",
"\n",
"\n",
"Fusing layers... \n",
"Fusing layers... \n",
"Model Summary: 476 layers, 87730285 parameters, 0 gradients\n",
"Model Summary: 476 layers, 87730285 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
653.03
it/s]\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",
"\u001b[34m\u001b[1mval: \u001b[0mNew cache created: ../datasets/coco/val2017.cache\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:
18<00:00, 2.00
it/s]\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.746 0.626 0.68 0.49\n",
" all 5000 36335 0.746 0.626 0.68 0.49\n",
"Speed: 0.1ms pre-process, 5.1ms inference, 1.
5
ms NMS per image at shape (32, 3, 640, 640)\n",
"Speed: 0.1ms pre-process, 5.1ms inference, 1.
6
ms NMS per image at shape (32, 3, 640, 640)\n",
"\n",
"\n",
"Evaluating pycocotools mAP... saving runs/val/exp/yolov5x_predictions.json...\n",
"Evaluating pycocotools mAP... saving runs/val/exp/yolov5x_predictions.json...\n",
"loading annotations into memory...\n",
"loading annotations into memory...\n",
"Done (t=0.4
4
s)\n",
"Done (t=0.4
6
s)\n",
"creating index...\n",
"creating index...\n",
"index created!\n",
"index created!\n",
"Loading and preparing results...\n",
"Loading and preparing results...\n",
"DONE (t=4.
82
s)\n",
"DONE (t=4.
94
s)\n",
"creating index...\n",
"creating index...\n",
"index created!\n",
"index created!\n",
"Running per image evaluation...\n",
"Running per image evaluation...\n",
"Evaluate annotation type *bbox*\n",
"Evaluate annotation type *bbox*\n",
"DONE (t=8
4.52
s).\n",
"DONE (t=8
3.60
s).\n",
"Accumulating evaluation results...\n",
"Accumulating evaluation results...\n",
"DONE (t=13.
8
2s).\n",
"DONE (t=13.
2
2s).\n",
" Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.504\n",
" Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.504\n",
" Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.688\n",
" Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.688\n",
" Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.546\n",
" Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.546\n",
...
@@ -784,7 +616,7 @@
...
@@ -784,7 +616,7 @@
" Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.524\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.524\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.735\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.735\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.827\n",
" Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.827\n",
"Results saved to
runs/val/exp
\n"
"Results saved to
\u001b[1mruns/val/exp\u001b[0m
\n"
],
],
"name": "stdout"
"name": "stdout"
}
}
...
@@ -841,54 +673,15 @@
...
@@ -841,54 +673,15 @@
{
{
"cell_type": "code",
"cell_type": "code",
"metadata": {
"metadata": {
"id": "Knxi2ncxWffW",
"id": "Knxi2ncxWffW"
"colab": {
"base_uri": "https://localhost:8080/",
"height": 66,
"referenced_widgets": [
"6ff8a710ded44391a624dec5c460b771",
"3c19729b51cd45d4848035da06e96ff8",
"23b2f0ae3d46438c8de375987c77f580",
"dd9498c321a9422da6faf17a0be026d4",
"d8dda4b2ce864fd682e558b9a48f602e",
"ff8151449e444a14869684212b9ab14e",
"0f84fe609bcf4aa9afdc32a8cf076909",
"8fda673769984e2b928ef820d34c85c3"
]
},
"outputId": "4510c6b0-8d2a-436c-d3f4-c8f8470d913a"
},
},
"source": [
"source": [
"# Download COCO128\n",
"# Download COCO128\n",
"torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/releases/download/v1.0/coco128.zip', 'tmp.zip')\n",
"torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/releases/download/v1.0/coco128.zip', 'tmp.zip')\n",
"!unzip -q tmp.zip -d ../ && rm tmp.zip"
"!unzip -q tmp.zip -d ../
datasets
&& rm tmp.zip"
],
],
"execution_count": null,
"execution_count": null,
"outputs": [
"outputs": []
{
"output_type": "display_data",
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6ff8a710ded44391a624dec5c460b771",
"version_minor": 0,
"version_major": 2
},
"text/plain": [
"HBox(children=(FloatProgress(value=0.0, max=6984509.0), HTML(value='')))"
]
},
"metadata": {
"tags": []
}
},
{
"output_type": "stream",
"text": [
"\n"
],
"name": "stdout"
}
]
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
...
@@ -935,40 +728,34 @@
...
@@ -935,40 +728,34 @@
"colab": {
"colab": {
"base_uri": "https://localhost:8080/"
"base_uri": "https://localhost:8080/"
},
},
"outputId": "
cd8ac17d-19a8-4e87-ab6a-31af1edac1ef
"
"outputId": "
00ea4b14-a75c-44a2-a913-03b431b69de5
"
},
},
"source": [
"source": [
"# Train YOLOv5s on COCO128 for 3 epochs\n",
"# Train YOLOv5s on COCO128 for 3 epochs\n",
"!python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache"
"!python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache"
],
],
"execution_count":
null
,
"execution_count":
8
,
"outputs": [
"outputs": [
{
{
"output_type": "stream",
"output_type": "stream",
"text": [
"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
_images=True, 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
\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, 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[1mgithub: \u001b[0mup to date with https://github.com/ultralytics/yolov5 ✅\n",
"\u001b[34m\u001b[1mgithub: \u001b[0mup to date with https://github.com/ultralytics/yolov5 ✅\n",
"YOLOv5 🚀 v5.0-3
30-g18f6ba7
torch 1.9.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5MB)\n",
"YOLOv5 🚀 v5.0-3
67-g01cdb76
torch 1.9.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5MB)\n",
"\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.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[1mWeights & Biases: \u001b[0mrun 'pip install wandb' to automatically track and visualize YOLOv5 🚀 runs (RECOMMENDED)\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",
"\u001b[34m\u001b[1mTensorBoard: \u001b[0mStart with 'tensorboard --logdir runs/train', view at http://localhost:6006/\n",
"2021-07-29 22:56:52.096481: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0\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",
"WARNING: Dataset not found, nonexistent paths: ['/content/datasets/coco128/images/train2017']\n",
"Downloading https://github.com/ultralytics/yolov5/releases/download/v1.0/coco128.zip ...\n",
"100% 6.66M/6.66M [00:00<00:00, 44.0MB/s]\n",
"Dataset autodownload success\n",
"\n",
"\n",
"\n",
" from n params module arguments \n",
" from n params module arguments \n",
" 0 -1 1 3520 models.common.Focus [3, 32, 3] \n",
" 0 -1 1 3520 models.common.Focus [3, 32, 3] \n",
" 1 -1 1 18560 models.common.Conv [32, 64, 3, 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",
" 2 -1 1 18816 models.common.C3 [64, 64, 1] \n",
" 3 -1 1 73984 models.common.Conv [64, 128, 3, 2] \n",
" 3 -1 1 73984 models.common.Conv [64, 128, 3, 2] \n",
" 4 -1
1
156928 models.common.C3 [128, 128, 3] \n",
" 4 -1
3
156928 models.common.C3 [128, 128, 3] \n",
" 5 -1 1 295424 models.common.Conv [128, 256, 3, 2] \n",
" 5 -1 1 295424 models.common.Conv [128, 256, 3, 2] \n",
" 6 -1
1
625152 models.common.C3 [256, 256, 3] \n",
" 6 -1
3
625152 models.common.C3 [256, 256, 3] \n",
" 7 -1 1 1180672 models.common.Conv [256, 512, 3, 2] \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",
" 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",
" 9 -1 1 1182720 models.common.C3 [512, 512, 1, False] \n",
...
@@ -993,11 +780,11 @@
...
@@ -993,11 +780,11 @@
"Scaled weight_decay = 0.0005\n",
"Scaled weight_decay = 0.0005\n",
"\u001b[34m\u001b[1moptimizer:\u001b[0m SGD with parameter groups 59 weight, 62 weight (no decay), 62 bias\n",
"\u001b[34m\u001b[1moptimizer:\u001b[0m SGD with parameter groups 59 weight, 62 weight (no decay), 62 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[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, 2
021.9
8it/s]\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, 2
440.2
8it/s]\n",
"\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: ../datasets/coco128/labels/train2017.cache\n",
"\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: ../datasets/coco128/labels/train2017.cache\n",
"\u001b[34m\u001b[1mtrain: \u001b[0mCaching images (0.1GB
): 100% 128/128 [00:00<00:00, 273.58
it/s]\n",
"\u001b[34m\u001b[1mtrain: \u001b[0mCaching images (0.1GB
ram): 100% 128/128 [00:00<00:00, 302.61
it/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<
00:00, 506004.63
it/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
): 100% 128/128 [00:01<00:00, 121.71
it/s]\n",
"\u001b[34m\u001b[1mval: \u001b[0mCaching images (0.1GB
ram): 100% 128/128 [00:00<00:00, 142.55
it/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",
"[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",
"Plotting labels... \n",
"Plotting labels... \n",
...
@@ -1009,23 +796,24 @@
...
@@ -1009,23 +796,24 @@
"Starting training for 3 epochs...\n",
"Starting training for 3 epochs...\n",
"\n",
"\n",
" Epoch gpu_mem box obj cls labels img_size\n",
" Epoch gpu_mem box obj cls labels img_size\n",
" 0/2 3.64G
0.0441 0.06646 0.02229 290 640: 100% 8/8 [00:04<00:00, 1.93
it/s]\n",
" 0/2 3.64G
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:0
1<00:00, 3.45
it/s]\n",
" Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:0
0<00:00, 4.70
it/s]\n",
" all 128 929 0.6
96 0.562 0.644 0.419
\n",
" all 128 929 0.6
86 0.565 0.642 0.421
\n",
"\n",
"\n",
" Epoch gpu_mem box obj cls labels img_size\n",
" Epoch gpu_mem box obj cls labels img_size\n",
" 1/2 5.04G 0.04
573 0.06289 0.021 226 640: 100% 8/8 [00:01<00:00, 5.46
it/s]\n",
" 1/2 5.04G 0.04
403 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:0
1<00:00, 3.1
6it/s]\n",
" Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:0
0<00:00, 4.4
6it/s]\n",
" all 128 929
0.71 0.567 0.654 0.424
\n",
" all 128 929
0.694 0.563 0.654 0.425
\n",
"\n",
"\n",
" Epoch gpu_mem box obj cls labels img_size\n",
" Epoch gpu_mem box obj cls labels img_size\n",
" 2/2 5.04G 0.04542 0.0715 0.02028 242 640: 100% 8/8 [00:01<00:00, 5.12it/s]\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.46it/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.731 0.563 0.658 0.427\n",
" all 128 929 0.711 0.562 0.66 0.431\n",
"3 epochs completed in 0.006 hours.\n",
"\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/last.pt, 14.8MB\n",
"Optimizer stripped from runs/train/exp/weights/best.pt, 14.8MB\n"
"Optimizer stripped from runs/train/exp/weights/best.pt, 14.8MB\n",
"Results saved to \u001b[1mruns/train/exp\u001b[0m\n"
],
],
"name": "stdout"
"name": "stdout"
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论