2020-01-06 00:43:14 +01:00
|
|
|
FROM debian:buster-slim
|
|
|
|
LABEL maintainer "blakeb@blakeshome.com"
|
2019-06-02 14:29:50 +02:00
|
|
|
|
2020-01-06 00:43:14 +01:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2019-05-27 17:17:57 +02:00
|
|
|
# Install packages for apt repo
|
2020-01-06 00:43:14 +01:00
|
|
|
RUN apt -qq update && apt -qq install --no-install-recommends -y \
|
|
|
|
gnupg wget \
|
|
|
|
ffmpeg \
|
|
|
|
python3 \
|
|
|
|
python3-pip \
|
|
|
|
# python-prctl
|
|
|
|
build-essential libcap-dev \
|
|
|
|
# pillow-simd
|
|
|
|
zlib1g-dev libjpeg-dev python3-dev\
|
|
|
|
# VAAPI drivers for Intel hardware accel
|
|
|
|
libva-drm2 libva2 i965-va-driver vainfo \
|
|
|
|
&& echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
|
|
|
|
&& wget -q -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
|
|
|
|
&& apt -qq update \
|
|
|
|
&& echo "libedgetpu1-max libedgetpu/accepted-eula boolean true" | debconf-set-selections \
|
|
|
|
&& apt -qq install --no-install-recommends -y \
|
|
|
|
libedgetpu1-max \
|
|
|
|
python3-edgetpu \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
&& (apt-get autoremove -y; apt-get autoclean -y)
|
|
|
|
|
|
|
|
# needs to be installed before others
|
|
|
|
RUN pip3 install -U wheel setuptools
|
|
|
|
|
|
|
|
RUN pip3 install -U \
|
|
|
|
opencv-python \
|
|
|
|
python-prctl \
|
|
|
|
numpy \
|
|
|
|
Flask \
|
|
|
|
paho-mqtt \
|
|
|
|
PyYAML \
|
|
|
|
matplotlib \
|
|
|
|
scipy \
|
|
|
|
pillow-simd
|
2019-01-26 15:02:59 +01:00
|
|
|
|
2019-03-30 13:58:31 +01:00
|
|
|
# symlink the model and labels
|
2020-01-06 00:43:14 +01:00
|
|
|
RUN wget -q https://github.com/google-coral/edgetpu/raw/master/test_data/mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite -O mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite --trust-server-names
|
|
|
|
RUN wget -q https://dl.google.com/coral/canned_models/coco_labels.txt -O coco_labels.txt --trust-server-names
|
2019-05-27 17:17:57 +02:00
|
|
|
RUN ln -s mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite /frozen_inference_graph.pb
|
|
|
|
RUN ln -s /coco_labels.txt /label_map.pbtext
|
2019-03-30 13:58:31 +01:00
|
|
|
|
2019-02-28 13:49:27 +01:00
|
|
|
WORKDIR /opt/frigate/
|
|
|
|
ADD frigate frigate/
|
2019-01-26 15:02:59 +01:00
|
|
|
COPY detect_objects.py .
|
2019-06-05 04:38:41 +02:00
|
|
|
COPY benchmark.py .
|
2019-01-26 15:02:59 +01:00
|
|
|
|
2019-03-17 15:03:52 +01:00
|
|
|
CMD ["python3", "-u", "detect_objects.py"]
|