Created using Colaboratory

This commit is contained in:
Glenn Jocher 2021-04-12 18:18:05 +02:00
parent 8eb4cde090
commit be29298b5c

20
tutorial.ipynb vendored
View File

@ -517,7 +517,7 @@
"colab_type": "text" "colab_type": "text"
}, },
"source": [ "source": [
"<a href=\"https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" "<a href=\"https://colab.research.google.com/github/ultralytics/yolov3/blob/master/tutorial.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
] ]
}, },
{ {
@ -529,7 +529,7 @@
"<img src=\"https://user-images.githubusercontent.com/26833433/99805971-90f66b80-2b3d-11eb-80eb-8b45a15cb68e.jpg\">\n", "<img src=\"https://user-images.githubusercontent.com/26833433/99805971-90f66b80-2b3d-11eb-80eb-8b45a15cb68e.jpg\">\n",
"\n", "\n",
"This is the **official YOLOv3 🚀 notebook** authored by **Ultralytics**, and is freely available for redistribution under the [GPL-3.0 license](https://choosealicense.com/licenses/gpl-3.0/). \n", "This is the **official YOLOv3 🚀 notebook** authored by **Ultralytics**, and is freely available for redistribution under the [GPL-3.0 license](https://choosealicense.com/licenses/gpl-3.0/). \n",
"For more information please visit https://github.com/ultralytics/yolov5 and https://www.ultralytics.com. Thank you!" "For more information please visit https://github.com/ultralytics/yolov3 and https://www.ultralytics.com. Thank you!"
] ]
}, },
{ {
@ -553,8 +553,8 @@
"outputId": "9b022435-4197-41fc-abea-81f86ce857d0" "outputId": "9b022435-4197-41fc-abea-81f86ce857d0"
}, },
"source": [ "source": [
"!git clone https://github.com/ultralytics/yolov5 # clone repo\n", "!git clone https://github.com/ultralytics/yolov3 # clone repo\n",
"%cd yolov5\n", "%cd yolov3\n",
"%pip install -qr requirements.txt # install dependencies\n", "%pip install -qr requirements.txt # install dependencies\n",
"\n", "\n",
"import torch\n", "import torch\n",
@ -563,7 +563,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": 31, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
@ -719,7 +719,7 @@
}, },
"source": [ "source": [
"# Run YOLOv3 on COCO val2017\n", "# Run YOLOv3 on COCO val2017\n",
"!python test.py --weights yolov5x.pt --data coco.yaml --img 640 --iou 0.65" "!python test.py --weights yolov3.pt --data coco.yaml --img 640 --iou 0.65"
], ],
"execution_count": null, "execution_count": null,
"outputs": [ "outputs": [
@ -1145,8 +1145,8 @@
"source": [ "source": [
"# Re-clone repo\n", "# Re-clone repo\n",
"%cd ..\n", "%cd ..\n",
"%rm -rf yolov5 && git clone https://github.com/ultralytics/yolov5\n", "%rm -rf yolov3 && git clone https://github.com/ultralytics/yolov3\n",
"%cd yolov5" "%cd yolov3"
], ],
"execution_count": null, "execution_count": null,
"outputs": [] "outputs": []
@ -1175,10 +1175,10 @@
"import torch\n", "import torch\n",
"\n", "\n",
"# Model\n", "# Model\n",
"model = torch.hub.load('ultralytics/yolov5', 'yolov3')\n", "model = torch.hub.load('ultralytics/yolov3', 'yolov3') # or 'yolov3_spp', 'yolov3_tiny'\n",
"\n", "\n",
"# Images\n", "# Images\n",
"dir = 'https://github.com/ultralytics/yolov5/raw/master/data/images/'\n", "dir = 'https://github.com/ultralytics/yolov3/raw/master/data/images/'\n",
"imgs = [dir + f for f in ('zidane.jpg', 'bus.jpg')] # batch of images\n", "imgs = [dir + f for f in ('zidane.jpg', 'bus.jpg')] # batch of images\n",
"\n", "\n",
"# Inference\n", "# Inference\n",