car-detection-bayes/examples.ipynb

340 lines
774 KiB
Plaintext
Raw Normal View History

2019-07-23 14:56:48 +00:00
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "ultralytics/YOLOv3",
"version": "0.3.2",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "HvhYZrIZCEyo"
},
"source": [
"<img src=\"https://storage.googleapis.com/ultralytics/logo/logoname1000.png\" width=\"150\">\n",
"\n",
"This notebook contains software developed by Ultralytics LLC, and **is freely available for redistribution under the GPL-3.0 license**. For more information please visit https://github.com/ultralytics/yolov3 and https://www.ultralytics.com.\n",
"\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "e5ylFIvlCEym",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "79e2ed76-f1d0-45b3-b4a7-4ed561623cf9"
},
"source": [
"import time\n",
"import glob\n",
"import torch\n",
"import os\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"\n",
"from IPython.display import Image \n",
"from IPython.display import clear_output\n",
"print('PyTorch %s %s' % (torch.__version__, torch.cuda.get_device_properties(0) if torch.cuda.is_available() else 'CPU'))"
],
"execution_count": 39,
"outputs": [
{
"output_type": "stream",
"text": [
"PyTorch 1.1.0 _CudaDeviceProperties(name='Tesla K80', major=3, minor=7, total_memory=11441MB, multi_processor_count=13)\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "7mGmQbAO5pQb",
"colab_type": "text"
},
"source": [
"Clone repository and download COCO 2014 dataset (20GB):"
]
},
{
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "tIFv0p1TCEyj",
"colab": {}
},
"source": [
"!git clone https://github.com/ultralytics/yolov3 # clone\n",
"!bash yolov3/data/get_coco_dataset_gdrive.sh # copy COCO2014 dataset (20GB)\n",
"%cd yolov3"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "N3qM6T0W53gh",
"colab_type": "text"
},
"source": [
"Run `detect.py` to perform inference on images in `data/samples` folder:"
]
},
{
"cell_type": "code",
"metadata": {
"id": "zR9ZbuQCH7FX",
"colab_type": "code",
"outputId": "49268b66-125d-425e-dbd0-17b108914c51",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 477
}
},
"source": [
"!python3 detect.py\n",
"Image(filename='output/zidane.jpg', width=600)"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"Namespace(cfg='cfg/yolov3-spp.cfg', conf_thres=0.5, data='data/coco.data', fourcc='mp4v', images='data/samples', img_size=416, nms_thres=0.5, output='output', weights='weights/yolov3-spp.weights')\n",
"Using CUDA with Apex device0 _CudaDeviceProperties(name='Tesla K80', total_memory=11441MB)\n",
"\n",
"image 1/2 data/samples/bus.jpg: 416x320 3 persons, 1 buss, 1 handbags, Done. (0.119s)\n",
"image 2/2 data/samples/zidane.jpg: 256x416 2 persons, 1 ties, Done. (0.085s)\n",
"Results saved to /content/yolov3/output\n"
],
"name": "stdout"
},
{
"output_type": "execute_result",
"data": {
"image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQEBAQIBAQECAgICAgQDAgICAgUEBAMEBgUGBgYF\nBgYGBwkIBgcJBwYGCAsICQoKCgoKBggLDAsKDAkKCgr/2wBDAQICAgICAgUDAwUKBwYHCgoKCgoK\nCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgr/wAARCALQBQADASIA\nAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA\nAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3\nODk6Q0RFRkdISUpT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7Tv3\nfL8tVri3DSPD9pUyr/F91d1aEljH/wAvMylG+4yp91aktdPeRc+Tv+f5fk3V9XluH5dTwcdiIx+0\nYLK6tvfcKry6bN5ezZ+7b/lpG+35q7BfDiNa+XNC37xtq7m27qdY+DXuN0m/hX/1f8NfY4ej7lz5\nXGYjm+E5C10e/Ece+2+fdtXb81XF8P7bqPztwkVGV9vyrt/2a7ux8KzRyJCkLM6/Nt3/ACtU7eDX\nkmj811Ty2+f91ub5q1lTjGZwRrcp5wuihpJIPmZGf/v2tQDwrMzHyXbZ93aqV6ovg/y5FT7zL99V\nT7y0kngvM3nfZmQbWZFWuKpR5vdN6dbl+0eUyeG7mO4Dp0Zf/Hqfp+jzQtLNczZK/wAP92vS28Hm\naOL/AEXa21n/
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {
"tags": [],
"image/jpeg": {
"width": 600
}
},
"execution_count": 26
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "ijTFlKcp6JVy",
"colab_type": "text"
},
"source": [
"Run `train.py` to train YOLOv3-SPP starting from a darknet53 backbone:"
]
},
{
"cell_type": "code",
"metadata": {
"id": "Mupsoa0lzSPo",
"colab_type": "code",
"colab": {}
},
"source": [
"!python3 train.py --data data/coco_64img.data --img-size 320 --epochs 3 --nosave"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "0eq1SMWl6Sfn",
"colab_type": "text"
},
"source": [
"Run `test.py` to evaluate the performance of a trained darknet or PyTorch model:"
]
},
{
"cell_type": "code",
"metadata": {
"id": "0v0RFtO-WG9o",
"colab_type": "code",
"colab": {}
},
"source": [
"!python3 test.py --data data/coco.data --save-json --img-size 416 # 0.565 mAP"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "VUOiNLtMP5aG",
"colab_type": "text"
},
"source": [
"Reproduce tutorial training runs and overlays results:"
]
},
{
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "LA9qqd_NCEyB",
2019-07-23 15:06:48 +00:00
"outputId": "82481ea3-00f4-4a01-9412-ca8d81eaa8b9",
2019-07-23 14:56:48 +00:00
"colab": {
"base_uri": "https://localhost:8080/",
"height": 417
}
},
"source": [
"!python3 train.py --nosave --batch-size 4 --accumulate 1 --data data/coco_16img.data && mv results.txt results0_16img.txt\n",
"!python3 train.py --nosave --batch-size 4 --accumulate 1 --data data/coco_64img.data && mv results.txt results0_64img.txt\n",
"!python3 -c \"from utils import utils; utils.plot_results()\" # plot training results\n",
"Image(filename='results.png', width=800)"
],
2019-07-23 15:06:48 +00:00
"execution_count": 42,
2019-07-23 14:56:48 +00:00
"outputs": [
{
"output_type": "execute_result",
"data": {
2019-07-23 15:06:48 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAACvAAAAV4CAYAAAB8IQgEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAewgAAHsIBbtB1PgAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzs3Xl8TNf/P/BXdhEhe6RBQgStpEgs\niS1BfRSxVVBU7VtV6UZREksRWtRSFE0+XVTRRVW1PiqLxBprqFpjSyUiRMi+3N8f+eV+701muZNM\nJgmv5+Mxj8c9M+ece2YmnDP3vs85RoIgCCAiIiIiIiIiIiIiIiIiIiIiIiIiIiKDMK7qBhARERER\nERERERERERERERERERERET1PGMBLRERERERERERERERERERERERERERkQAzgJSIiIiIiIiIiIiIi\nIiIiIiIiIiIiMiAG8BIRERERERERERERERERERERERERERkQA3iJiIiIiIiIiIiIiIiIiIiIiIiI\niIgMiAG8REREREREREREREREREREREREREREBsQAXiIiIiIiIiIiIiIiIiIiIiIiIiIiIgNiAC8R\nEREREREREREREREREREREREREZEBMYCXiIiIiIiIiIiIiIiIiIiIiIiIiIjIgBjAS0RERERERERE\nREREREREREREREREZEAM4CUiIiIiIiIiIiIiIiIiIiIiIiIiIjIgBvASERERERERERERERERERER\nEREREREZEAN4iYiIiIiIiIiIiIiIiIiIiIiIiIiIDIgBvERERERERERERERERERERERERERERAbE\nAF4iIiIiIiIiIiIiIiIiIiIiIiIiIiIDYgAvERERERERERERERERERERERERERGRATGAl4iIiIiI\niIiIiIiIiIiIiIiIiIiIyIAYwEtERERERERERERERERERERERERERGRADOAlIiIiIiIiIiIiIiIi\nIiIiIiIiIiIyIAbwEhERERERERERERERERERERERERERGRADeImIiIiIiIiIiIiIiIiIiIiIiIiI\niAyIAbxEREREREREREREREREREREREREREQGxABeIiIiIiIiIiIiIiIiIiIiIiIiIiIiA2IALxER\nERERERERERERERERERERERERkQExgJeIiIiIiIiIiIiIiIiIiIiIiIiIiMiAGMBLRERERERERERE\nRERERERERERERERkQAzgJSIiIiIiIiIiIiIiIiIiIiIiIiIiMiAG8BIRERERERERERERERERERER\nERERERkQA3iJiIiIiIiIiIiIiIiIiIiIiIiIiIgMiAG8REREREREREREREREREREREREREREBsQA\nXiIiIiIiIiIiIiIiIiIiIiIiIiIiIgNiAC8REREREVWKqKgoGBkZiQ99k9YdFRWl9/rHjBkj1j9m\nzBi91/+8CgwMFD/X0NDQKmlDaGio2IbAwMAqaQMRERERERERERERERERPd8YwEv0HHvy5AkOHTqE\n7du3Y+3atfjkk0+wbt06fPPNNzh69CgyMzOruolERERERERERKQHKSkpCAkJgb+/P+zt7WFqaqpy\nQktERIT4vLu7u17bcPPmTdkkrJs3b+q1fiIiopqusicr11TlGZ88fvwYn376KQIDA+Hk5AQzMzOV\ndVT2BPSahGM1IiIiZd5++22xvwwODq7q5hBRDWda1Q0gIsPKzs7Gl19+iV27duH48eMoKChQm9fY\n2BitW7dGcHAwhg0bhiZNmmitX3pxY/To0YiIiNBHsxWLiopCt27dxHR4eLjOK+ZFRERg7NixYjoy\nMlKnldmWLl2KefPmAQDeeecdfP755wCACRMmYNu2bWK+AwcOoGfPnorrTUxMhLe3txhY3aFDB8TF\nxaGwsBA+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H37dowYMUJRu48ePSquFAwAI0eOxIABAxSVJSKi6qF08Gx0dLSi\nAN6SFV21PafKkSNHZKv5l16xPjAwUOPNK5I7deqUONGqRYsWaNq0aRW3qHJwC1AiIqpsGzZsQGho\nKB48eKAof1JSEj799FN89tlnGDlyJJYuXfpMrZL3zTff4P79+wCKg1d27NiBfv36PfdbRBMREVUE\nxxvV1/79+/H3338DKN6J6Msvv8SYMWNgavr83BaPiooSJxcHBAQwgJeIiIiIqBp7fn6pED2nBEHA\nsGHDZKux2tjY4P3338eMGTNgbW2ttmxWVhZ+++03fPLJJzh//rwhmlvj7du3D0VFRQCAXr16ldm6\nvE+fPnjzzTfx9ddfAwA2b96MoUOHolu3bmrrvHnzJmbPni2m27ZtK5sZVSIkJAS//vorLly4AACY\nPn06evToAWdnZ41tzsnJwdixY8V2169fH2vXrlXwbomIqDp56aWX4OTkJAZnREdHY86cOVrLSYN1\nrayskJmZiePHjyM3NxcWFhaKywLVdwXemkLdKv5ERESkTH5+PiZPnozw8HDZ81ZWVggMDISvry8c\nHR1haWmJ5ORk3L59GwcOHMDNmzcBFF9D+fbbb2Fvb481a9ZUwTuoHIcOHRKPR40ahf79+2vMP2bM\nGAZ5EBERqcHxRtXQZXwiHfv07NkTEyZM0JifE9D/j7u7Oz8LIiJSzMzMDB4eHlrz3b9/H0+ePBHT\nSspU952C169fj/Xr11d1M4joGcEAXqJn3KeffioL3m3WrBn++OMPRVsZ1K5dG0OHDsWQIUPwww8/\nYNq0aZXZ1GeCNPAmKChIZZ41a9bgwIEDSE5OhiAIGD9+PBISEmBlZVUmb8nrT58+BVC8anJ4eLi4\nzZOUubk5IiIi4Ofnh4KCAjx8+BBTpkyRff+qLFiwAJcvXxbTmzdvrvYDYiIiUq1r167iSvlxcXEo\nKCjQuLpIZmYmT
2019-07-23 14:56:48 +00:00
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {
"tags": [],
"image/png": {
"width": 800
}
},
2019-07-23 15:06:48 +00:00
"execution_count": 42
2019-07-23 14:56:48 +00:00
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "14mT7T7Q6erR",
"colab_type": "text"
},
"source": [
"Extras below\n",
"\n",
"---\n",
"\n",
"\n"
]
},
2019-07-23 15:06:48 +00:00
{
"cell_type": "code",
"metadata": {
"id": "42_zEpW6W_N1",
"colab_type": "code",
"colab": {}
},
"source": [
"!git pull"
],
"execution_count": 0,
"outputs": []
},
2019-07-23 14:56:48 +00:00
{
"cell_type": "code",
"metadata": {
"id": "9bVTcveIOzDd",
"colab_type": "code",
"colab": {}
},
"source": [
"%cd yolov3"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "odMr0JFnCEyb",
"colab": {}
},
"source": [
"!ls"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "uB3v5hj_CEyI",
"colab": {}
},
"source": [
"# Unit Tests\n",
"!python3 detect.py # detect 2 persons, 1 tie\n",
"!python3 test.py --data data/coco_32img.data # test mAP = 0.8\n",
"!python3 train.py --data data/coco_32img.data --epochs 3 --nosave # train 3 epochs"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "6D0si0TNCEx5",
"colab": {}
},
"source": [
"# Evolve Hyperparameters\n",
"!python3 train.py --data data/coco.data --img-size 320 --epochs 1 --evolve"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "JGI1Q-4UCExz",
"colab": {}
},
"source": [
"# Plot Training Results\n",
"!python3 -c \"from utils import utils; utils.plot_results()\""
],
"execution_count": 0,
"outputs": []
}
]
}