ubuntu16.04安裝densepose模型
阿新 • • 發佈:2018-12-18
densepose是一個比較先進的3D姿態估計模型,很厲害,具體可以見官網:http://densepose.org/
一,安裝caffe2和Detectron:
按照這個連結絕對沒問題
二,Install the COCO API:
1,定位到要下載的路徑:
git clone https://github.com/cocodataset/cocoapi.git $COCOAPI
cd $COCOAPI/PythonAPI
2,安裝
make install
出錯如下:
解決方案:
pip install cython
成功。。
3,測試,如果在python中輸入 import pycocotools.coco不出錯就ok
出錯,解決方案:sudo apt-get install python-tk
再次測試:成功:
三:densepose搭建
1,Clone the Densepose repository:
it clone https://github.com/facebookresearch/densepose $DENSEPOSE
2,Install Python dependencies:
pip install -r $DENSEPOSE/requirements.txt
3,Set up Python modules:
cd $DENSEPOSE && make python2 $DENSEPOSE/detectron/tests/test_spatial_narrow_as_op.py
4,Build the custom operators library:
cd $DENSEPOSE && make ops
5.Check that the custom operator tests pass:
python2 $DENSEPOSE/detectron/tests/test_zero_even_op.py
出現上圖說明現在densepose已經完全搭建好了,enjoy............................................................
四,測試應用,這個模型可研究性很大,我先放個我提uv圖的demo,更深入的見官網
用人家的模型測試圖片:
python2 tools/infer_simple.py \
--cfg configs/DensePose_ResNet101_FPN_s1x-e2e.yaml \
--output-dir DensePoseData/infer_out/ \
--image-ext jpg \
--wts https://s3.amazonaws.com/densepose/DensePose_ResNet101_FPN_s1x-e2e.pkl \
DensePoseData/demo_data/demo_im.jpg