You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains a pure Python implementation (multi-pose only) of the Google TensorFlow.js Posenet model. For a (slightly faster) PyTorch implementation that followed from this, see (https://github.com/rwightman/posenet-pytorch)
4
-
5
-
I first adapted the JS code more or less verbatim and found the performance was low so made some vectorized numpy/scipy version of a few key functions (named `_fast`).
3
+
This repository contains a pure Python implementation (multi-pose only) of the Google TensorFlow.js Posenet model.
6
4
7
5
Further optimization is possible
8
6
* The base MobileNet models have a throughput of 200-300 fps on a GTX 1080 Ti (or better)
@@ -11,26 +9,10 @@ Further optimization is possible
11
9
* My 'fast' post processing results in 90-110fps
12
10
* A Cython or pure C++ port would be even better...
13
11
14
-
### Install
15
-
16
-
A suitable Python 3.x environment with a recent version of Tensorflow is required.
17
-
18
-
Development and testing was done with Conda Python 3.6.8 and Tensorflow 1.12.0 on Linux.
19
-
20
-
Windows 10 with the latest (as of 2019-01-19) 64-bit Python 3.7 Anaconda installer was also tested.
21
-
22
-
If you want to use the webcam demo, a pip version of opencv (`pip install opencv-python`) is required instead of the conda version. Anaconda's default opencv does not include ffpmeg/VideoCapture support. Also, you may have to force install version 3.4.x as 4.x has a broken drawKeypoints binding.
23
-
24
-
A conda environment setup as below should suffice:
There are three demo apps in the root that utilize the PoseNet model. They are very basic and could definitely be improved.
15
+
There are multiple demo apps in the root that utilize the PoseNet model. They are very basic and could definitely be improved.
34
16
35
17
The first time these apps are run (or the library is used) model weights will be downloaded from the TensorFlow.js version and converted on the fly.
36
18
@@ -50,7 +32,17 @@ A minimal performance benchmark based on image_demo. Images in `--image_dir` are
50
32
51
33
#### webcam_demo.py
52
34
53
-
The webcam demo uses OpenCV to capture images from a connected webcam. The result is overlayed with the keypoints and skeletons and rendered to the screen. The default args for the webcam_demo assume device_id=0 for the camera and that 1280x720 resolution is possible.
35
+
Shows a stick figure pose in real-time using a web-cam. To overlay the stick figure on background turn on the "bgimage" parameter
36
+
37
+
#### webcam_demo_react.py
38
+
39
+
Fun game that uses hand detection and calculates reaction time taken to touch targets with hand.
40
+
41
+
#### webcam_demo_circles2.py
42
+
43
+
Matches real-time pose to a pre-set pose based on lower body keypoints.
44
+
45
+
54
46
55
47
### Credits
56
48
@@ -60,10 +52,3 @@ This port and my work is in no way related to Google.
60
52
61
53
The Python conversion code that started me on my way was adapted from the CoreML port at https://github.com/infocom-tpo/PoseNet-CoreML
62
54
63
-
### TODO (someday, maybe)
64
-
* More stringent verification of correctness against the original implementation
65
-
* Performance improvements (especially edge loops in 'decode.py')
0 commit comments