Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b57d9eb

Browse files
committed
update
1 parent 1b9d60d commit b57d9eb

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

‎CVC-YOLOv3/yolo_tutorial.ipynb‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,18 @@
447447
"metadata": {},
448448
"outputs": [],
449449
"source": [
450-
"from IPython.display import Video\n",
450+
"from IPython.display import HTML\n",
451+
"from base64 import b64encode\n",
451452
"\n",
452453
"! wget https://storage.googleapis.com/mit-driverless-open-source/test_yolo_video.mp4\n",
453454
"\n",
454455
"! ffmpeg -i test_yolo_video.mp4 test.mp4 && rm test_yolo_video.mp4\n",
455456
"\n",
456-
"Video(\"test.mp4\")"
457+
"video_path = 'test.mp4'\n",
458+
"\n",
459+
"mp4 = open(video_path,'rb').read()\n",
460+
"decoded_vid = \"data:video/mp4;base64,\" + b64encode(mp4).decode()\n",
461+
"HTML(f'<video width=400 controls><source src={decoded_vid} type=\"video/mp4\"></video>')"
457462
]
458463
},
459464
{
@@ -562,7 +567,11 @@
562567
"source": [
563568
"! cd outputs/visualization/ && ffmpeg -i test.mp4 output.mp4 && rm test.mp4 && cd ../..\n",
564569
"\n",
565-
"Video(\"outputs/visualization/output.mp4\")"
570+
"video_path = \"outputs/visualization/output.mp4\"\n",
571+
"\n",
572+
"mp4 = open(video_path,'rb').read()\n",
573+
"decoded_vid = \"data:video/mp4;base64,\" + b64encode(mp4).decode()\n",
574+
"HTML(f'<video width=400 controls><source src={decoded_vid} type=\"video/mp4\"></video>')"
566575
]
567576
},
568577
{

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /