2020-01-17 00:14:58 +01:00
|
|
|
FROM ubuntu:18.04
|
2020-01-06 00:43:14 +01:00
|
|
|
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 \
|
2020-01-28 14:24:02 +01:00
|
|
|
software-properties-common \
|
|
|
|
# apt-transport-https ca-certificates \
|
|
|
|
build-essential \
|
2020-05-01 13:59:24 +02:00
|
|
|
gnupg wget unzip tzdata \
|
2020-01-28 14:24:02 +01:00
|
|
|
# libcap-dev \
|
|
|
|
&& add-apt-repository ppa:deadsnakes/ppa -y \
|
|
|
|
&& apt -qq install --no-install-recommends -y \
|
|
|
|
python3.7 \
|
|
|
|
python3.7-dev \
|
|
|
|
python3-pip \
|
|
|
|
ffmpeg \
|
|
|
|
# VAAPI drivers for Intel hardware accel
|
|
|
|
libva-drm2 libva2 i965-va-driver vainfo \
|
|
|
|
&& python3.7 -m pip install -U wheel setuptools \
|
|
|
|
&& python3.7 -m pip install -U \
|
|
|
|
opencv-python-headless \
|
|
|
|
# python-prctl \
|
|
|
|
numpy \
|
|
|
|
imutils \
|
2020-01-31 17:50:42 +01:00
|
|
|
scipy \
|
2020-07-09 13:57:16 +02:00
|
|
|
psutil \
|
2020-01-31 17:50:42 +01:00
|
|
|
&& python3.7 -m pip install -U \
|
2020-02-16 04:07:54 +01:00
|
|
|
Flask \
|
|
|
|
paho-mqtt \
|
|
|
|
PyYAML \
|
|
|
|
matplotlib \
|
|
|
|
pyarrow \
|
2020-09-07 19:17:42 +02:00
|
|
|
click \
|
2020-01-06 00:43:14 +01:00
|
|
|
&& 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 \
|
2020-01-28 14:24:02 +01:00
|
|
|
libedgetpu1-max \
|
|
|
|
## Tensorflow lite (python 3.7 only)
|
2020-03-02 13:11:19 +01:00
|
|
|
&& wget -q https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_x86_64.whl \
|
|
|
|
&& python3.7 -m pip install tflite_runtime-2.1.0.post1-cp37-cp37m-linux_x86_64.whl \
|
|
|
|
&& rm tflite_runtime-2.1.0.post1-cp37-cp37m-linux_x86_64.whl \
|
2020-01-06 00:43:14 +01:00
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
&& (apt-get autoremove -y; apt-get autoclean -y)
|
|
|
|
|
2020-02-18 12:55:06 +01:00
|
|
|
# get model and labels
|
2020-07-26 19:03:44 +02:00
|
|
|
RUN wget -q https://github.com/google-coral/edgetpu/raw/master/test_data/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite -O /edgetpu_model.tflite --trust-server-names
|
2020-09-07 19:17:42 +02:00
|
|
|
COPY labelmap.txt /labelmap.txt
|
2020-07-26 19:03:44 +02:00
|
|
|
RUN wget -q https://github.com/google-coral/edgetpu/raw/master/test_data/ssd_mobilenet_v2_coco_quant_postprocess.tflite -O /cpu_model.tflite
|
2020-07-02 15:43:33 +02:00
|
|
|
|
2019-03-30 13:58:31 +01:00
|
|
|
|
2020-07-26 14:50:30 +02:00
|
|
|
RUN mkdir /cache /clips
|
2020-07-09 13:57:16 +02: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 .
|
2020-02-22 15:59:16 +01:00
|
|
|
COPY benchmark.py .
|
2019-01-26 15:02:59 +01:00
|
|
|
|
2020-02-18 12:55:06 +01:00
|
|
|
CMD ["python3.7", "-u", "detect_objects.py"]
|