From 62d77a10274e55134e0ef1cec258b4ed6446cd3d Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 3 Nov 2021 18:55:25 +0100 Subject: [PATCH] Created using Colaboratory --- tutorial.ipynb | 327 ++++++++++++++++++++++++++++++------------------- 1 file changed, 199 insertions(+), 128 deletions(-) diff --git a/tutorial.ipynb b/tutorial.ipynb index 115d767a7..b81db0de6 100644 --- a/tutorial.ipynb +++ b/tutorial.ipynb @@ -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_78cceec059784f2bb36988d3336e4d56", + "layout": "IPY_MODEL_769ecde6f2e64bacb596ce972f8d3d2d", "_model_module": "@jupyter-widgets/controls", "children": [ - "IPY_MODEL_ab93d8b65c134605934ff9ec5efb1bb6", - "IPY_MODEL_30df865ded4c434191bce772c9a82f3a", - "IPY_MODEL_20cdc61eb3404f42a12b37901b0d85fb" + "IPY_MODEL_384a001876054c93b0af45cd1e960bfe", + "IPY_MODEL_dded0aeae74440f7ba2ffa0beb8dd612", + "IPY_MODEL_5296d28be75740b2892ae421bbec3657" ] } }, - "78cceec059784f2bb36988d3336e4d56": { + "769ecde6f2e64bacb596ce972f8d3d2d": { "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.4MB/s]", + "value": " 780M/780M [00:11<00:00, 91.9MB/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": "8b728908-81ab-4861-edb0-4d0c46c439fb" + "outputId": "8f7e6588-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 🚀 v5.0-367-g01cdb76 torch 1.9.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160.5MB)\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 🚀 v6.0-48-g84a8099 torch 1.10.0+cu102 CUDA:0 (Tesla V100-SXM2-16GB, 16160MiB)\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", - "78cceec059784f2bb36988d3336e4d56", - "ab93d8b65c134605934ff9ec5efb1bb6", - "30df865ded4c434191bce772c9a82f3a", - "20cdc61eb3404f42a12b37901b0d85fb", - "2d7239993a9645b09b221405ac682743", - "17b5a87f92104ec7ab96bf507637d0d2", - "2358bfb2270247359e94b066b3cc3d1f", - "3e984405db654b0b83b88b2db08baffd", - "654d8a19b9f949c6bbdaf8b0875c931e", - "896030c5d13b415aaa05032818d81a6e" + "eb95db7cae194218b3fcefb439b6352f", + "769ecde6f2e64bacb596ce972f8d3d2d", + "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