-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile.dlib.cv
88 lines (81 loc) · 2.67 KB
/
Dockerfile.dlib.cv
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
77
78
79
80
81
82
83
84
85
86
87
88
#Note:
# If I build this on my Arch Linux desktop it works fine locally,
# but dlib gives an `Illegal Instruction (core dumped)` error in
# dlib.get_frontal_face_detector() when running on OSX in a Docker machine.
# Building in a Docker machine on OSX fixes this issue and the built
# container successfully deploys on my Arch Linux desktop.
#
# Building and pushing:
# docker build -f Dockerfile.dlib.cv -t opencv-dlib .
FROM ubuntu:14.04
MAINTAINER Ian Philips <[email protected]>
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
curl \
gfortran \
git \
graphicsmagick \
libgraphicsmagick1-dev \
libatlas-dev \
libavcodec-dev \
libavformat-dev \
libboost-all-dev \
libgtk2.0-dev \
libjpeg-dev \
liblapack-dev \
libswscale-dev \
pkg-config \
python-dev \
python-numpy \
python-protobuf\
software-properties-common \
zip \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#RUN curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash -e
#RUN git clone https://github.com/torch/distro.git ~/torch --recursive
#RUN cd ~/torch && ./install.sh && \
# cd install/bin && \
# ./luarocks install nn && \
# ./luarocks install dpnn && \
# ./luarocks install image && \
# ./luarocks install optim && \
# ./luarocks install csvigo && \
# ./luarocks install torchx && \
# ./luarocks install tds
RUN cd ~ && \
mkdir -p ocv-tmp && \
cd ocv-tmp && \
curl -L https://github.com/Itseez/opencv/archive/2.4.11.zip -o ocv.zip && \
unzip ocv.zip && \
cd opencv-2.4.11 && \
mkdir release && \
cd release && \
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D BUILD_PYTHON_SUPPORT=ON \
.. && \
make -j8 && \
make install && \
rm -rf ~/ocv-tmp
RUN cd ~ && \
mkdir -p dlib-tmp && \
cd dlib-tmp && \
curl -L \
https://github.com/davisking/dlib/archive/v19.0.tar.gz \
-o dlib.tar.bz2 && \
tar xf dlib.tar.bz2 && \
cd dlib-19.0/python_examples && \
mkdir build && \
cd build && \
cmake ../../tools/python && \
cmake --build . --config Release && \
cp dlib.so /usr/local/lib/python2.7/dist-packages && \
rm -rf ~/dlib-tmp
#Unocmment below lines if you're the grim reaper and you're trying to use this dockerfile instead of the one supplied by the face recognition project
#COPY . /root/face_recognition
#RUN cd /root/face_recognition && \
# pip3 install -r requirements.txt && \
# python3 setup.py install
#CMD cd /root/face_recognition/examples && \
# python3 recognize_faces_in_pictures.py