-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile-openpose-gpu
76 lines (64 loc) · 2.03 KB
/
Dockerfile-openpose-gpu
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Install openpose
FROM nvidia/cuda:8.0-cudnn6-devel-ubuntu16.04 as openpose
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y \
wget \
unzip \
lsof \
apt-utils \
lsb-core \
libatlas-base-dev \
libopencv-dev \
python-opencv \
python-pip \
build-essential \
libprotobuf-dev \
libleveldb-dev \
libsnappy-dev \
libhdf5-serial-dev \
protobuf-compiler \
cmake \
libgflags-dev \
libgoogle-glog-dev \
liblmdb-dev
RUN apt-get install --no-install-recommends -y libboost-all-dev
# Get Caffe
ENV CAFFE_ROOT=/caffe
COPY --from=bvlc/caffe:gpu /opt/caffe $CAFFE_ROOT
RUN ln -s $CAFFE_ROOT/build/include/caffe/proto $CAFFE_ROOT/include/caffe/proto
COPY --from=bvlc/caffe:gpu /usr/local/lib/libnccl.so.1.3.5 /usr/local/lib/libnccl.so.1.3.5
ENV PYCAFFE_ROOT $CAFFE_ROOT/python
ENV PYTHONPATH $PYCAFFE_ROOT:$PYTHONPATH
ENV PATH $CAFFE_ROOT/build/tools:$PYCAFFE_ROOT:$PATH
RUN echo "$CAFFE_ROOT/build/lib" >> /etc/ld.so.conf.d/caffe.conf && ldconfig
RUN wget https://github.com/CMU-Perceptual-Computing-Lab/openpose/archive/master.zip; \
unzip master.zip; rm master.zip; mv openpose-master openpose
WORKDIR openpose/build
RUN cmake \
-DBUILD_CAFFE=OFF \
-DCaffe_INCLUDE_DIRS=$CAFFE_ROOT/include \
-DCaffe_LIBS=$CAFFE_ROOT/build/lib/libcaffe.so \
-DDOWNLOAD_BODY_25_MODEL=OFF \
-DDOWNLOAD_BODY_COCO_MODEL=ON \
-DDOWNLOAD_FACE_MODEL=OFF \
-DDOWNLOAD_HAND_MODEL=OFF \
-DDOWNLOAD_BODY_MPI_MODEL=OFF \
-DBUILD_PYTHON=ON \
-DGPU_MODE=CUDA \
..
RUN make -j`nproc`
RUN make install
ENV OPENPOSEPYTHON=/usr/local/python/
ENV PYTHONPATH $OPENPOSEPYTHON:$PYTHONPATH
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update
RUN apt-get install -y \
python3.6 \
python3.6-dev \
python3-pip
WORKDIR /requirements
COPY requirements.txt requirements.txt
RUN python3.6 -m pip install pip --upgrade
RUN python3.6 -m pip install -r requirements.txt
WORKDIR /openpose-action-recognition