-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.32v7
48 lines (36 loc) · 1.79 KB
/
Dockerfile.32v7
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
FROM armv7/armhf-debian
MAINTAINER MD Islam <[email protected]
# Original https://github.com/iMelnik/rpi-python3-tensorflow-opencv
RUN apt-get update && \
apt-get -q -y install --no-install-recommends python3 \
python3-dev python3-pip build-essential cmake \
pkg-config libjpeg-dev libtiff5-dev \
libpng-dev libavcodec-dev libavformat-dev libswscale-dev \
libv4l-dev libxvidcore-dev libx264-dev python3-yaml \
python3-scipy python3-h5py git && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Tensorflow
ADD https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v1.0.0/tensorflow-1.0.0-cp34-cp34m-linux_armv7l.whl /tensorflow-1.0.0-cp34-cp34m-linux_armv7l.whl
RUN pip3 install /tensorflow-1.0.0-cp34-cp34m-linux_armv7l.whl && rm /tensorflow-1.0.0-cp34-cp34m-linux_armv7l.whl
# OpenCV
ENV OPENCV_VERSION="3.2.0"
ENV OPENCV_DIR="/opt/opencv/"
ADD https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.tar.gz ${OPENCV_DIR}
RUN cd ${OPENCV_DIR} && \
tar -xzf ${OPENCV_VERSION}.tar.gz && \
rm ${OPENCV_VERSION}.tar.gz && \
mkdir ${OPENCV_DIR}opencv-${OPENCV_VERSION}/build && \
cd ${OPENCV_DIR}opencv-${OPENCV_VERSION}/build && \
cmake -D BUILD_JPEG=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. && make -j4 && make install && \
mv /usr/local/lib/python3.4/dist-packages/cv2.cpython-34m.so /usr/local/lib/python3.4/dist-packages/cv2.so && \
rm -rf ${OPENCV_DIR}
COPY requirements.txt /src/requirements/requirements.txt
RUN pip3 install -r /src/requirements/requirements.txt
RUN git clone https://github.com/thtrieu/darkflow.git \
&& cd darkflow \
&& python3 setup.py build_ext --inplace \
&& pip3 install . \
&& cd .. \
&& rm -rf darkflow
WORKDIR /src/app
CMD ["python3", "api.py"]