Browse Source

Created using Colaboratory

5.0
Glenn Jocher 4 years ago
parent
commit
1b1681bac9
1 changed files with 8 additions and 8 deletions
  1. +8
    -8
      tutorial.ipynb

+ 8
- 8
tutorial.ipynb View File

"clear_output()\n", "clear_output()\n",
"print('Setup complete. Using torch %s %s' % (torch.__version__, torch.cuda.get_device_properties(0) if torch.cuda.is_available() else 'CPU'))" "print('Setup complete. Using torch %s %s' % (torch.__version__, torch.cuda.get_device_properties(0) if torch.cuda.is_available() else 'CPU'))"
], ],
"execution_count": 1,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
"gdrive_download('1Y6Kou6kEB0ZEMCCpJSKStCor4KAReE43','coco2017val.zip') # val2017 dataset\n", "gdrive_download('1Y6Kou6kEB0ZEMCCpJSKStCor4KAReE43','coco2017val.zip') # val2017 dataset\n",
"!mv ./coco ../ # move folder alongside /yolov5" "!mv ./coco ../ # move folder alongside /yolov5"
], ],
"execution_count": 10,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
"# Run YOLOv5x on COCO val2017\n", "# Run YOLOv5x on COCO val2017\n",
"!python test.py --weights yolov5x.pt --data coco.yaml --img 672" "!python test.py --weights yolov5x.pt --data coco.yaml --img 672"
], ],
"execution_count": 15,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
"gdrive_download('1n_oKgR81BJtqk75b00eAjdv03qVCQn2f','coco128.zip') # coco128 dataset\n", "gdrive_download('1n_oKgR81BJtqk75b00eAjdv03qVCQn2f','coco128.zip') # coco128 dataset\n",
"!mv ./coco128 ../ # move folder alongside /yolov5" "!mv ./coco128 ../ # move folder alongside /yolov5"
], ],
"execution_count": 16,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
"# 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 --cfg yolov5s.yaml --weights yolov5s.pt --nosave --cache" "!python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --cfg yolov5s.yaml --weights yolov5s.pt --nosave --cache"
], ],
"execution_count": 24,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
"colab_type": "text" "colab_type": "text"
}, },
"source": [ "source": [
"Training losses and performance metrics are saved to Tensorboard and also to a `runs/exp0/results.txt` logfile. `results.txt` is plotted as `results.png` after training completes. Partially completed `results.txt` files can be plotted with `from utils.utils import plot_results; plot_results()`. Here we show YOLOv5s trained on coco128 to 300 epochs, starting from scratch (orange), and from pretrained `yolov5s.pt` (blue)."
"Training losses and performance metrics are saved to Tensorboard and also to a `runs/exp0/results.txt` logfile. `results.txt` is plotted as `results.png` after training completes. Partially completed `results.txt` files can be plotted with `from utils.utils import plot_results; plot_results()`. Here we show YOLOv5s trained on coco128 to 300 epochs, starting from scratch (blue), and from pretrained `yolov5s.pt` (orange)."
] ]
}, },
{ {
"source": [ "source": [
"from utils.utils import plot_results; plot_results() # plot results.txt files as results.png" "from utils.utils import plot_results; plot_results() # plot results.txt files as results.png"
], ],
"execution_count": 29,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "execute_result", "output_type": "execute_result",
"!rm -rf yolov5 && git clone https://github.com/ultralytics/yolov5\n", "!rm -rf yolov5 && git clone https://github.com/ultralytics/yolov5\n",
"%cd yolov5" "%cd yolov5"
], ],
"execution_count": 9,
"execution_count": null,
"outputs": [] "outputs": []
}, },
{ {

Loading…
Cancel
Save