赞
踩
Can not find Openpose Python API
docker pull exsidius/openpose
#### 查看镜像
sudo docker images
#### 新建容器并进入容器 sudo docker run -itd --name stgcn --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 -p 8022:22 -p 5000:5000 -v /data/chengzhang/:/data/chengzhang/ e01a654ba06f /bin/bash #### 提示错误 WARNING: IPv4 forwarding is disabled. Networking will not work #### 解决办法 vim /usr/lib/sysctl.d/00-system.conf #### 添加如下代码: net.ipv4.ip_forward=1 保存退出重启网络 systemctl restart network #### 删除早先建立容器然后重新建容器并进入 sudo docker rm stgcn sudo docker exec -it stgcn /bin/bash #### 进入容器后 sudo apt-get update #### 提示如下错误 E: Some index files failed to download, they have been ignored, or old ones used instead #### 解决办法,对于我适用,可以将目录下/var/lib/apt/lists/partial/所有的文件清掉 rm /var/lib/apt/lists/* -rvf sudo apt-get update apt-get install vim apt-get install sudo apt-get install iputils-ping apt-get install net-tools
git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose
cd 3rdparty/
git clone https://github.com/CMU-Perceptual-Computing-Lab/caffe
cd openpose
sudo bash ./scripts/ubuntu/install_deps.sh
mkdir build
cd build
cmake -D BUILD_PYTHON=ON .. // 为了安装python openpose api
make -j12
sudo make instal // 等待安装后进行下一步
cd build/python/openpose/
sudo cp pyopenpose.cpython-35m-x86_64-linux-gnu.so /usr/local/lib/python3.5/dist-packages/
cd /usr/local/lib/python3.5/dist-packages
sudo ln -s pyopenpose.cpython-36m-x86_64-linux-gnu.so pyopenpose
#### 确认环境变量中 LD_LIBRARY_PATH 包含 /usr/local/lib/python3.5/dist-packages
vim ~/.bashrc
// 添加 下面一行
LD_LIBRARY_PATH=/usr/local/lib/python3.5/dist-packages
// 保存退出
source ~/.bashrc
运行样例,将样例中的下面一行修改
// from openpose import pyopenpose as op 注释
import pyopenpose as op
cd openpose/build/examples/tutorial_api_python
// 由于server版本 无界面,修改**01_body_from_image.py**内容
// 注释
// cv2.imshow("OpenPose 1.7.0 - Tutorial Python API", datum.cvOutputData)
// cv2.waitKey(0)
// 添加
cv2.imwrite('demo.png', datum.cvOutputData)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。