/
Dockerfile.rpi-armv7
91 lines (63 loc) · 4.67 KB
/
Dockerfile.rpi-armv7
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
89
90
FROM balenalib/raspberrypi3-debian-python:3.7.9-build
RUN [ "cross-build-start" ]
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list
RUN echo "deb https://packages.cloud.google.com/apt coral-cloud-stable main" > /etc/apt/sources.list.d/coral-cloud.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y --allow-downgrades \
git vim less wget \
python3-matplotlib python3-numpy python3-sklearn python3-opencv python3-h5py python3-pandas python3-scipy python3-uvloop \
libmosquitto-dev \
fonts-freefont-ttf \
libatlas-base-dev \
libfreetype6-dev \
libjpeg-dev \
zlib1g-dev \
libpng-dev \
libedgetpu-dev libedgetpu1-std
# OpenCV deps
RUN apt-get install -y libaom0 libatlas3-base libavcodec58 libavformat58 libavutil56 libbluray2 libcairo2 libchromaprint1 libcodec2-0.8.1 libcroco3 libdatrie1 libdrm2 libfontconfig1 libgdk-pixbuf2.0-0 libgfortran5 libgme0 libgraphite2-3 libgsm1 libharfbuzz0b libjbig0 libmp3lame0 libmpg123-0 libogg0 libopenjp2-7 libopenmpt0 libopus0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 librsvg2-2 libshine3 libsnappy1v5 libsoxr0 libspeex1 libssh-gcrypt-4 libswresample3 libswscale5 libthai0 libtheora0 libtiff5 libtwolame0 libva-drm2 libva-x11-2 libva2 libvdpau1 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx5 libwavpack1 libwebp6 libwebpmux3 libx264-155 libx265-165 libxcb-render0 libxcb-shm0 libxfixes3 libxrender1 libxvidcore4 libzvbi0
RUN pip3 install --upgrade pip wheel setuptools
# Hold numpy at 1.19.2 to support various binary packages
RUN pip3 install --index-url https://www.piwheels.org/simple --only-binary=:all: opencv-python>=4.5.4 numpy==1.19.2 mtcnn
WORKDIR /tmp
RUN curl -OL https://github.com/PINTO0309/TensorflowLite-bin/releases/download/v2.9.0/tflite_runtime-2.9.0-cp37-none-linux_armv7l.whl
RUN pip3 install --only-binary=:all: tflite_runtime-2.9.0-cp37-none-linux_armv7l.whl
# RUN pip3 install --index-url https://www.piwheels.org/simple -U -i https://www.piwheels.org/simple opencv-python keras pandas==1.1.5 matplotlib cycler uvloop==0.14.0 numpy quart gmqtt cameratransform pillow pytz python-dateutil # --platform linux/arm/v7 --only-binary=:all:
RUN pip3 install --index-url https://www.piwheels.org/simple --only-binary=:all: -U keras==2.3.1 pandas==1.1.5 matplotlib cycler uvloop==0.14.0 quart hypercorn gmqtt cameratransform pillow pytz python-dateutil
RUN pip3 install --extra-index-url https://www.piwheels.org/simple https://files.pythonhosted.org/packages/74/7e/622d9849abf3afb81e482ffc170758742e392ee129ce1540611199a59237/tensorflow_estimator-2.4.0-py2.py3-none-any.whl https://files.pythonhosted.org/packages/02/83/179c8f76e5716030cc3ee9433721161cfcc1d854e9ba20c9205180bb100a/tensorboard-2.4.0-py3-none-any.whl
RUN pip3 install --extra-index-url https://www.piwheels.org/simple --only-binary=:all: https://github.com/bitsy-ai/tensorflow-arm-bin/releases/download/v2.4.0/tensorflow-2.4.0-cp37-none-linux_armv7l.whl
# RUN pip3 install https://github.com/google-coral/pycoral/releases/download/release-frogfish/tflite_runtime-2.5.0-cp37-cp37m-linux_armv7l.whl \
# https://github.com/google-coral/pycoral/releases/download/v1.0.1/pycoral-1.0.1-cp37-cp37m-linux_armv7l.whl
RUN pip3 install --only-binary=:all: tflite_support
USER root
RUN mkdir -p /deepdish/detectors/yolo
RUN wget -O /deepdish/detectors/yolo/yolo.h5 https://github.com/OlafenwaMoses/ImageAI/releases/download/1.0/yolo.h5
ARG USER_ID
ARG GROUP_ID
RUN addgroup --gid $GROUP_ID user
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid 0 user
RUN adduser user plugdev
RUN adduser user video
RUN mkdir -p /work
RUN chown -R user:user /work # /yolo
# Allow password-less 'root' login with 'su'
RUN passwd -d root
RUN sed -i 's/nullok_secure/nullok/' /etc/pam.d/common-auth
RUN echo '#!/bin/bash\nPYTHONPATH=/deepdish:$PYTHONPATH DEEPDISHHOME=/deepdish python3 /deepdish/deepdish.py $@' > /usr/bin/deepdish.sh
COPY yolov5-demo.sh /usr/bin
RUN chmod +x /usr/bin/deepdish.sh /usr/bin/yolov5-demo.sh
COPY *.py /deepdish/
COPY detectors/mobilenet/* /deepdish/detectors/mobilenet/
COPY detectors/efficientdet_lite0/* /deepdish/detectors/efficientdet_lite0/
COPY detectors/yolov5/* /deepdish/detectors/yolov5/
COPY encoders/* /deepdish/encoders/
COPY tools/*.py /deepdish/tools/
COPY deep_sort/*.py /deepdish/deep_sort/
COPY deepdish/*.py /deepdish/deepdish/
COPY bicycle_test1.mp4 /deepdish
RUN [ "cross-build-end" ]
USER user
WORKDIR /work
CMD /bin/bash