|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "code", |
| 5 | + "execution_count": null, |
| 6 | + "id": "07236d7c", |
| 7 | + "metadata": { |
| 8 | + "ExecuteTime": { |
| 9 | + "start_time": "2021-10-21T09:52:57.162Z" |
| 10 | + } |
| 11 | + }, |
| 12 | + "outputs": [], |
| 13 | + "source": [ |
| 14 | + "!git clone -q https://github.com/hysts/pytorch_mpiigaze_demo\n", |
| 15 | + "!cd pytorch_mpiigaze_demo && python setup.py install\n", |
| 16 | + "!pip install -U pyyaml" |
| 17 | + ] |
| 18 | + }, |
| 19 | + { |
| 20 | + "cell_type": "code", |
| 21 | + "execution_count": null, |
| 22 | + "id": "a7f04682", |
| 23 | + "metadata": { |
| 24 | + "ExecuteTime": { |
| 25 | + "start_time": "2021-10-21T09:53:05.033Z" |
| 26 | + } |
| 27 | + }, |
| 28 | + "outputs": [], |
| 29 | + "source": [ |
| 30 | + "!ptgaze --mode eth-xgaze --video pytorch_mpiigaze_demo/assets/inputs/video01.mp4 --o . --no-screen" |
| 31 | + ] |
| 32 | + }, |
| 33 | + { |
| 34 | + "cell_type": "code", |
| 35 | + "execution_count": null, |
| 36 | + "id": "af873e50", |
| 37 | + "metadata": { |
| 38 | + "ExecuteTime": { |
| 39 | + "start_time": "2021-10-21T09:53:12.015Z" |
| 40 | + } |
| 41 | + }, |
| 42 | + "outputs": [], |
| 43 | + "source": [ |
| 44 | + "!ffmpeg -i video01.avi -c:v libx264 out.mp4" |
| 45 | + ] |
| 46 | + }, |
| 47 | + { |
| 48 | + "cell_type": "code", |
| 49 | + "execution_count": null, |
| 50 | + "id": "ead94a63", |
| 51 | + "metadata": { |
| 52 | + "ExecuteTime": { |
| 53 | + "start_time": "2021-10-21T09:53:24.304Z" |
| 54 | + } |
| 55 | + }, |
| 56 | + "outputs": [], |
| 57 | + "source": [ |
| 58 | + "from IPython.display import HTML\n", |
| 59 | + "from base64 import b64encode\n", |
| 60 | + "\n", |
| 61 | + "HTML(f\"\"\"\n", |
| 62 | + "<video height=400 controls>\n", |
| 63 | + " <source src=\"data:video/mp4;base64,{b64encode(open('out.mp4','rb').read()).decode()}\" type=\"video/mp4\">\n", |
| 64 | + "</video>\n", |
| 65 | + "\"\"\")" |
| 66 | + ] |
| 67 | + }, |
| 68 | + { |
| 69 | + "cell_type": "code", |
| 70 | + "execution_count": null, |
| 71 | + "id": "4cd9b150", |
| 72 | + "metadata": {}, |
| 73 | + "outputs": [], |
| 74 | + "source": [] |
| 75 | + } |
| 76 | + ], |
| 77 | + "metadata": { |
| 78 | + "kernelspec": { |
| 79 | + "display_name": "Python 3", |
| 80 | + "language": "python", |
| 81 | + "name": "python3" |
| 82 | + }, |
| 83 | + "language_info": { |
| 84 | + "codemirror_mode": { |
| 85 | + "name": "ipython", |
| 86 | + "version": 3 |
| 87 | + }, |
| 88 | + "file_extension": ".py", |
| 89 | + "mimetype": "text/x-python", |
| 90 | + "name": "python", |
| 91 | + "nbconvert_exporter": "python", |
| 92 | + "pygments_lexer": "ipython3", |
| 93 | + "version": "3.9.5" |
| 94 | + }, |
| 95 | + "toc": { |
| 96 | + "base_numbering": 1, |
| 97 | + "nav_menu": {}, |
| 98 | + "number_sections": true, |
| 99 | + "sideBar": true, |
| 100 | + "skip_h1_title": false, |
| 101 | + "title_cell": "Table of Contents", |
| 102 | + "title_sidebar": "Contents", |
| 103 | + "toc_cell": false, |
| 104 | + "toc_position": {}, |
| 105 | + "toc_section_display": true, |
| 106 | + "toc_window_display": false |
| 107 | + } |
| 108 | + }, |
| 109 | + "nbformat": 4, |
| 110 | + "nbformat_minor": 5 |
| 111 | +} |
0 commit comments