Skip to content

Commit

Permalink
Fix errors in TankTracking notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasrenault committed Jun 12, 2023
1 parent f820271 commit 38e79ae
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions adomvi/TankTracking.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "5b271582-9f4f-4bc1-913a-1b238fa64cfa",
"metadata": {},
Expand All @@ -11,6 +12,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "d2d605d4-7f62-4284-93e8-96223a87bbe9",
"metadata": {},
Expand All @@ -28,7 +30,10 @@
"outputs": [],
"source": [
"!git clone https://github.com/mikel-brostrom/yolo_tracking.git # clone repo\n",
"%pip install -qr yolo_tracking/requirements.txt # install dependencies\n",
"%cd yolo_tracking\n",
"!pip install -v -e .\n",
"%pip install ultralytics lap\n",
"%cd ..\n",
"\n",
"import torch\n",
"from IPython.display import Image, clear_output\n",
Expand All @@ -38,6 +43,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "0131177a-985c-4a0e-8232-db6ab760131f",
"metadata": {},
Expand Down Expand Up @@ -101,6 +107,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "7d07280b-6a27-4c60-b366-7e9883ef540c",
"metadata": {},
Expand All @@ -120,6 +127,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "2e736b05-2aa8-4ed3-95c3-1e89bce07880",
"metadata": {},
Expand Down Expand Up @@ -721,10 +729,11 @@
}
],
"source": [
"!python yolo_tracking/examples/track.py --yolo-model yolov8n-tanks.pt --source tank2.mp4 --save --project runs/track"
"!python yolo_tracking/examples/track.py --yolo-model yolov8n-tanks.pt --reid-model mobilenetv2_x1_4_dukemtmcreid.pt --source tank2.mp4 --save --project runs/track"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "969c0edc-e126-4bfd-9159-0c6433fd1919",
"metadata": {},
Expand All @@ -733,6 +742,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "0fc8e2ab-8b2a-4365-a596-b48aa40df5ae",
"metadata": {},
Expand Down Expand Up @@ -820,6 +830,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "3c26f9a0-e248-4983-8314-ce44ac790626",
"metadata": {},
Expand All @@ -834,7 +845,10 @@
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import HTML"
"from IPython.display import HTML\n",
"from base64 import b64encode\n",
"mp4 = open('output.mp4','rb').read()\n",
"data_url = \"data:video/mp4;base64,\" + b64encode(mp4).decode()"
]
},
{
Expand All @@ -859,10 +873,11 @@
}
],
"source": [
"%%HTML\n",
"<video width=\"640\" controls>\n",
" <source src=\"output.mp4\" type=\"video/mp4\">\n",
"</video>"
"HTML(\"\"\"\n",
"<video controls width=\"640\">\n",
" <source src=\"%s\" type=\"video/mp4\">\n",
"</video>\n",
"\"\"\" % data_url)"
]
},
{
Expand Down
Binary file modified resources/tank1.mp4
Binary file not shown.
Binary file modified resources/tank3.mp4
Binary file not shown.
Binary file modified resources/tank4.mp4
Binary file not shown.

0 comments on commit 38e79ae

Please sign in to comment.