-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (49 loc) · 1.93 KB
/
Copy pathDockerfile
File metadata and controls
63 lines (49 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# https://hub.docker.com/r/cwaffles/openpose
FROM nvidia/cuda:10.0-cudnn7-devel
#get deps
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3-dev python3-pip git g++ wget make libprotobuf-dev protobuf-compiler libopencv-dev \
libgoogle-glog-dev libboost-all-dev libcaffe-cuda-dev libhdf5-dev libatlas-base-dev \
python3-setuptools vim libgtk2.0-dev libgtk-3-dev
#for python api
RUN pip3 install cmake
RUN pip3 install scikit-build
RUN pip3 install numpy
# Install OpenCV
RUN mkdir -p /opencv
WORKDIR /opencv
RUN git clone https://github.com/hmurari/openpose-docker
WORKDIR /opencv/openpose-docker
RUN chmod +x installOpencv.sh
RUN ./installOpencv.sh
#replace cmake as old version has CUDA variable bugs
RUN wget https://github.com/Kitware/CMake/releases/download/v3.16.0/cmake-3.16.0-Linux-x86_64.tar.gz && \
tar xzf cmake-3.16.0-Linux-x86_64.tar.gz -C /opt && \
rm cmake-3.16.0-Linux-x86_64.tar.gz
ENV PATH="/opt/cmake-3.16.0-Linux-x86_64/bin:${PATH}"
#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 -DWITH_GTK=ON -DUSE_CUDNN=ON .. && make -j `nproc`
WORKDIR /openpose
# Build and install Openpose python
WORKDIR /openpose/build/python/openpose
RUN make install
RUN cp ./pyopenpose.cpython-36m-x86_64-linux-gnu.so /usr/local/lib/python3.6/dist-packages
WORKDIR /usr/local/lib/python3.6/dist-packages
RUN ln -s pyopenpose.cpython-36m-x86_64-linux-gnu.so pyopenpose
ENV LD_LIBRARY_PATH="/usr/local/lib/python3.6/dist-packages:${LD_LIBRARY_PATH}"
# Download the model files.
WORKDIR /openpose/models
RUN chmod +x ./getModels.sh
RUN ./getModels.sh
# Pull test code
WORKDIR /openpose
RUN git clone https://github.com/hmurari/pose2
# Pull Examples code.
WORKDIR /openpose/examples
RUN git clone https://github.com/hmurari/openpose-examples.git
WORKDIR /openpose/examples/openpose-examples