openpose-docker-python/Dockerfile

42 lines
1.2 KiB
Docker
Raw Normal View History

2022-10-31 13:37:33 +00:00
# modified from https://hub.docker.com/r/cwaffles/openpose
FROM nvidia/cuda:11.4.0-cudnn8-devel-ubuntu20.04
#get deps
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3-dev python3-pip python3-setuptools git g++ wget make libprotobuf-dev protobuf-compiler libopencv-dev \
libgoogle-glog-dev libboost-all-dev libhdf5-dev libatlas-base-dev build-essential libgflags-dev \
liblmdb-dev
RUN apt-get install -y cmake
#for python api
RUN pip3 install --upgrade pip
RUN pip3 install numpy opencv-python
#get openpose
WORKDIR /openpose
RUN git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose.git .
#build it
WORKDIR /openpose/build
RUN cmake -DBUILD_PYTHON=ON .. && make -j `nproc`
# fetch models
WORKDIR /openpose/models
RUN ./getModels.sh
# Install python
WORKDIR /openpose/build/python/openpose
RUN make install
RUN cp /openpose/build/python/openpose/pyopenpose.cpython-38-x86_64-linux-gnu.so /usr/local/lib/python3.8/dist-packages/
WORKDIR /usr/local/lib/python3.8/dist-packages
RUN ln -s pyopenpose.cpython-38-x86_64-linux-gnu.so pyopenpose
#ENV LD_LIBRARY_PATH=/openpose/build/python/openpose
RUN apt-get install -y ffmpeg
WORKDIR /openpose