Browse Source

Created using Colaboratory

modifyDataloader
Glenn Jocher 3 years ago
parent
commit
b27f69f108
1 changed files with 31 additions and 7 deletions
  1. +31
    -7
      tutorial.ipynb

+ 31
- 7
tutorial.ipynb View File

"2e915d9016c846e095e382b6a02ee773": { "2e915d9016c846e095e382b6a02ee773": {
"model_module": "@jupyter-widgets/controls", "model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel", "model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": { "state": {
"_view_name": "HBoxView", "_view_name": "HBoxView",
"_dom_classes": [], "_dom_classes": [],
"cb7fc3a5c6cc4fde8d2c83e594a7c86e": { "cb7fc3a5c6cc4fde8d2c83e594a7c86e": {
"model_module": "@jupyter-widgets/base", "model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel", "model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": { "state": {
"_view_name": "LayoutView", "_view_name": "LayoutView",
"grid_template_rows": null, "grid_template_rows": null,
"ac3edef4e3434f4587e6cbf8aa048770": { "ac3edef4e3434f4587e6cbf8aa048770": {
"model_module": "@jupyter-widgets/controls", "model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel", "model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": { "state": {
"_view_name": "ProgressView", "_view_name": "ProgressView",
"style": "IPY_MODEL_13842ca90c0047e584b8d68d99dad2b1", "style": "IPY_MODEL_13842ca90c0047e584b8d68d99dad2b1",
"853ac234cc2a4236946fc516871e10eb": { "853ac234cc2a4236946fc516871e10eb": {
"model_module": "@jupyter-widgets/controls", "model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel", "model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": { "state": {
"_view_name": "HTMLView", "_view_name": "HTMLView",
"style": "IPY_MODEL_f94a7ca8c1f04761bf38fdc5f99664b8", "style": "IPY_MODEL_f94a7ca8c1f04761bf38fdc5f99664b8",
"13842ca90c0047e584b8d68d99dad2b1": { "13842ca90c0047e584b8d68d99dad2b1": {
"model_module": "@jupyter-widgets/controls", "model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel", "model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": { "state": {
"_view_name": "StyleView", "_view_name": "StyleView",
"_model_name": "ProgressStyleModel", "_model_name": "ProgressStyleModel",
"f454999c3a924c7bad0746fb453dec36": { "f454999c3a924c7bad0746fb453dec36": {
"model_module": "@jupyter-widgets/base", "model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel", "model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": { "state": {
"_view_name": "LayoutView", "_view_name": "LayoutView",
"grid_template_rows": null, "grid_template_rows": null,
"f94a7ca8c1f04761bf38fdc5f99664b8": { "f94a7ca8c1f04761bf38fdc5f99664b8": {
"model_module": "@jupyter-widgets/controls", "model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel", "model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": { "state": {
"_view_name": "StyleView", "_view_name": "StyleView",
"_model_name": "DescriptionStyleModel", "_model_name": "DescriptionStyleModel",
"9da1a23b042c41618dd14b0e30aa7cbe": { "9da1a23b042c41618dd14b0e30aa7cbe": {
"model_module": "@jupyter-widgets/base", "model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel", "model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": { "state": {
"_view_name": "LayoutView", "_view_name": "LayoutView",
"grid_template_rows": null, "grid_template_rows": null,
"6ff8a710ded44391a624dec5c460b771": { "6ff8a710ded44391a624dec5c460b771": {
"model_module": "@jupyter-widgets/controls", "model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel", "model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": { "state": {
"_view_name": "HBoxView", "_view_name": "HBoxView",
"_dom_classes": [], "_dom_classes": [],
"3c19729b51cd45d4848035da06e96ff8": { "3c19729b51cd45d4848035da06e96ff8": {
"model_module": "@jupyter-widgets/base", "model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel", "model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": { "state": {
"_view_name": "LayoutView", "_view_name": "LayoutView",
"grid_template_rows": null, "grid_template_rows": null,
"23b2f0ae3d46438c8de375987c77f580": { "23b2f0ae3d46438c8de375987c77f580": {
"model_module": "@jupyter-widgets/controls", "model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel", "model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": { "state": {
"_view_name": "ProgressView", "_view_name": "ProgressView",
"style": "IPY_MODEL_d8dda4b2ce864fd682e558b9a48f602e", "style": "IPY_MODEL_d8dda4b2ce864fd682e558b9a48f602e",
"dd9498c321a9422da6faf17a0be026d4": { "dd9498c321a9422da6faf17a0be026d4": {
"model_module": "@jupyter-widgets/controls", "model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel", "model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": { "state": {
"_view_name": "HTMLView", "_view_name": "HTMLView",
"style": "IPY_MODEL_0f84fe609bcf4aa9afdc32a8cf076909", "style": "IPY_MODEL_0f84fe609bcf4aa9afdc32a8cf076909",
"d8dda4b2ce864fd682e558b9a48f602e": { "d8dda4b2ce864fd682e558b9a48f602e": {
"model_module": "@jupyter-widgets/controls", "model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel", "model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": { "state": {
"_view_name": "StyleView", "_view_name": "StyleView",
"_model_name": "ProgressStyleModel", "_model_name": "ProgressStyleModel",
"ff8151449e444a14869684212b9ab14e": { "ff8151449e444a14869684212b9ab14e": {
"model_module": "@jupyter-widgets/base", "model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel", "model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": { "state": {
"_view_name": "LayoutView", "_view_name": "LayoutView",
"grid_template_rows": null, "grid_template_rows": null,
"0f84fe609bcf4aa9afdc32a8cf076909": { "0f84fe609bcf4aa9afdc32a8cf076909": {
"model_module": "@jupyter-widgets/controls", "model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel", "model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": { "state": {
"_view_name": "StyleView", "_view_name": "StyleView",
"_model_name": "DescriptionStyleModel", "_model_name": "DescriptionStyleModel",
"8fda673769984e2b928ef820d34c85c3": { "8fda673769984e2b928ef820d34c85c3": {
"model_module": "@jupyter-widgets/base", "model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel", "model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": { "state": {
"_view_name": "LayoutView", "_view_name": "LayoutView",
"grid_template_rows": null, "grid_template_rows": null,
"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": 1,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
"\n", "\n",
"`detect.py` runs YOLOv5 inference on a variety of sources, downloading models automatically from the [latest YOLOv5 release](https://github.com/ultralytics/yolov5/releases), and saving results to `runs/detect`. Example inference sources are:\n", "`detect.py` runs YOLOv5 inference on a variety of sources, downloading models automatically from the [latest YOLOv5 release](https://github.com/ultralytics/yolov5/releases), and saving results to `runs/detect`. Example inference sources are:\n",
"\n", "\n",
"<img align=\"left\" src=\"https://user-images.githubusercontent.com/26833433/114307955-5c7e4e80-9ae2-11eb-9f50-a90e39bee53f.png\" width=\"900\"> "
"```shell\n",
"python detect.py --source 0 # webcam\n",
" file.jpg # image \n",
" file.mp4 # video\n",
" path/ # directory\n",
" path/*.jpg # glob\n",
" 'https://youtu.be/NUsoVlDFqZg' # YouTube\n",
" 'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream\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": 9,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
"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": 10,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "display_data", "output_type": "display_data",
"# 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": 11,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
"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 ../ && rm tmp.zip"
], ],
"execution_count": 12,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "display_data", "output_type": "display_data",
"# 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": 13,
"execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",

Loading…
Cancel
Save