Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
hysts committed Oct 21, 2021
1 parent 28597e6 commit 2e7023d
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# A demo program of gaze estimation models (MPIIGaze, MPIIFaceGaze, ETH-XGaze)

[![PyPI version](https://badge.fury.io/py/ptgaze.svg)](https://pypi.org/project/ptgaze/)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/hysts/pytorch_mpiigaze_demo/blob/master/demo.ipynb)

With this program, you can run gaze estimation on images and videos.
By default, the video from a webcam will be used.
Expand Down
111 changes: 111 additions & 0 deletions demo.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "07236d7c",
"metadata": {
"ExecuteTime": {
"start_time": "2021-10-21T09:52:57.162Z"
}
},
"outputs": [],
"source": [
"!git clone -q https://github.com/hysts/pytorch_mpiigaze_demo\n",
"!cd pytorch_mpiigaze_demo && python setup.py install\n",
"!pip install -U pyyaml"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a7f04682",
"metadata": {
"ExecuteTime": {
"start_time": "2021-10-21T09:53:05.033Z"
}
},
"outputs": [],
"source": [
"!ptgaze --mode eth-xgaze --video pytorch_mpiigaze_demo/assets/inputs/video01.mp4 --o . --no-screen"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "af873e50",
"metadata": {
"ExecuteTime": {
"start_time": "2021-10-21T09:53:12.015Z"
}
},
"outputs": [],
"source": [
"!ffmpeg -i video01.avi -c:v libx264 out.mp4"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ead94a63",
"metadata": {
"ExecuteTime": {
"start_time": "2021-10-21T09:53:24.304Z"
}
},
"outputs": [],
"source": [
"from IPython.display import HTML\n",
"from base64 import b64encode\n",
"\n",
"HTML(f\"\"\"\n",
"<video height=400 controls>\n",
" <source src=\"data:video/mp4;base64,{b64encode(open('out.mp4','rb').read()).decode()}\" type=\"video/mp4\">\n",
"</video>\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4cd9b150",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 5
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _get_requirements(path):

setup(
name='ptgaze',
version='0.2.3',
version='0.2.4',
author='hysts',
url='https://github.com/hysts/pytorch_mpiigaze_demo',
python_requires='>=3.7',
Expand Down

0 comments on commit 2e7023d

Please sign in to comment.