【精华】ubuntu编译openpose

文章目录

      • (1)参考资料
      • (2)opencv编译
      • (3)Openpose编译
      • (4)异常问题

(1)参考资料

ubuntu20 openpose cuda11.7 cudnn8 opencv4.7.0_Nightmare004的博客-CSDN博客

(2)opencv编译

ubuntu安装opencv

# (1)ubuntu20依赖安装
sudo apt-get install build-essential libavcodec-dev libavformat-dev libjpeg.dev libtiff5.dev libswscale-dev cmake g++ wget unzip pkg-config ffmpeg libpng-dev libjpeg-dev libopenexr-dev libtiff-dev libwebp-dev libtiff5-dev libxvidcore-dev libx264-dev libxine2-dev libv4l-dev v4l-utils libatlas-base-dev gfortran libeigen3-dev mesa-utils libgl1-mesa-dri -y

sudo apt-get install libgtk2.0-dev libgtk-3-dev -y
sudo apt-get install libgtkgl2.0-dev libgtkglext1-dev -y

sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev -y

# (2)编译
unzip opencv-4.7.0.zip
mkdir -p build && cd build
cmake -D OPENCV_DOWNLOAD_MIRROR_ID=gitcode -D BUILD_TIFF=ON -D OPENCV_GENERATE_PKGCONFIG=ON ..
make -j 8
sudo make install
sudo ldconfig 

# (3)测试
pkg-config --modversion opencv4

(3)Openpose编译

ubuntu下安装openpose超详细以及一些踩过的坑

在python环境下使用Openposes_python

OpenCV安装包下载地址

# (1)项目及依赖包下载
git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose
cd openpose/

cd 3rdparty
git clone https://github.com/pybind/pybind11
git clone https://github.com/CMU-Perceptual-Computing-Lab/caffe.git
cd ..

git submodule update --init --recursive --remote

cd ..
cd scripts/ubuntu
bash install_deps.sh
cd ..

# (2)编译
cd openpose/
mkdir build && cd build
cmake -D USE_CUDNN=OFF DBUILD_PYTHON=ON ..
make -j 8

# (3)测试
# Video
./build/examples/openpose/openpose.bin --video examples/media/video.avi
# Camera
./build/examples/openpose/openpose.bin --face --hand
# Picture
./build/examples/openpose/openpose.bin --image_dir examples/media/ --face --hand

(4)异常问题

1 Syntax error: end of file unexpected (expecting “then”) 或者Syntax error: end of file unexpected (expecting “do”)

linux脚本相关: Syntax error: end of file unexpected (expecting “then“) 或者Syntax error: end of file unexp_syntax error: end of file unexpected (expecting…)

你可能感兴趣的:(计算机视觉,Linux,ubuntu,webpack,linux)