一、github項目
https://github.com/ildoonet/tf-pose-estimation
1.部署環境時候遇到的問題
① 按照文檔配置環境,其中visual C++ Build tools需要單獨安裝。參考文檔
②pip安裝pycocotools報錯“ERROR: Failed building wheel for pycocotools”
解決措施,在虛擬環境中先安裝git 然后使用git安裝pycocotools
conda install git
pip install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI
③No module named 'tensorflow.contrib.tensorrt'
解決措施參考鏈接:
先將tfpose/estimator.py中的14行#import tensorflow.contrib.tensorrt as trt注釋掉
再將run_webcam.py中10行注釋掉
④swig沒安裝上
windows下SWIG需要去官網下載一個安裝包
https://sourceforge.net/projects/swig/files/
二、用三種模式測試
①圖片
Test Inference
You can test the inference feature with a single image.
$ python run.py --model=mobilenet_thin --resize=432x368 --image=./images/p1.jpg
②攝像頭
Realtime Webcam
$ python run_webcam.py --model=mobilenet_thin --resize=432x368 --camera=0
③視頻