-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
61 lines (51 loc) · 2.13 KB
/
Dockerfile
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
FROM python:3.7-slim AS bearid-build
RUN apt-get -y update \
&& apt-get install -y build-essential cmake \
&& apt-get install -y wget \
&& rm -rf /var/lib/apt/lists/*
# for opencv
# RUN apt-get install -y libopencv-dev
# BLAS
RUN apt-get -y update && apt-get install -y libopenblas-dev liblapack-dev
# Boost
RUN wget -q https://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.bz2 \
&& mkdir -p /usr/share/boost && tar jxf boost_1_58_0.tar.bz2 -C /usr/share/boost --strip-components=1 \
&& ln -s /usr/share/boost/boost /usr/include/boost
RUN apt-get -y update && apt-get install -y libboost-all-dev
# X11 dev
RUN apt-get -y update && apt-get install -y libx11-dev
# dlib 19.7 (http://dlib.net/files/dlib-19.7.tar.bz2)
RUN wget -q http://dlib.net/files/dlib-19.7.tar.bz2 \
&& tar -xjf dlib-19.7.tar.bz2
# build and install imglab
RUN cd dlib-19.7/tools/imglab \
&& mkdir build \
&& cd build \
&& cmake .. \
&& cmake --build . --config Release \
&& make install
# bearid
RUN apt-get -y update && apt-get install -y git
RUN git clone https://github.com/hypraptive/bearid.git \
&& cd bearid \
&& mkdir build \
&& cd build \
&& cmake -DDLIB_PATH=/dlib-19.7 .. \
&& cmake --build . --config Release
# bearid-models
RUN cd / \
&& git clone https://github.com/hypraptive/bearid-models.git
# && mv bearid-models/*.dat . \
# && cp ../bearid.py .
# RUN
FROM python:3.7-slim
RUN apt-get -y update && apt-get install -y libx11-dev
RUN apt-get -y update && apt-get install -y libopenblas-dev liblapack-dev
RUN apt-get -y update && apt-get install -y libboost-filesystem1.67.0
COPY --from=bearid-build /bearid/build/bear* /
COPY --from=bearid-build /bearid/bearid.py /
COPY --from=bearid-build /usr/local/bin/imglab /usr/local/bin/imglab
COPY --from=bearid-build /bearid-models/*.dat /
WORKDIR /
# CMD ["python","bearid.py","/home/data/bears/imageSourceSmall/images"]
CMD python bearid.py /home/data/bears/imageSourceSmall/images && sed -i 's;/home/data/bears/imageSourceSmall/images/;;' ./result/imgs_faces_chips_embeds_svm.xml && mv ./result/imgs_faces_chips_embeds_svm.xml /home/data/bears/imageSourceSmall/images