Files
frigate/Dockerfile
T

62 lines
2.5 KiB
Docker
Raw Normal View History

2020-01-16 17:14:58 -06:00
FROM ubuntu:18.04
2020-01-05 17:43:14 -06:00
LABEL maintainer "blakeb@blakeshome.com"
2020-01-05 17:43:14 -06:00
ENV DEBIAN_FRONTEND=noninteractive
2019-05-27 10:17:57 -05:00
# Install packages for apt repo
2020-01-05 17:43:14 -06:00
RUN apt -qq update && apt -qq install --no-install-recommends -y \
2020-01-28 07:24:02 -06:00
software-properties-common \
# apt-transport-https ca-certificates \
build-essential \
2020-02-18 05:55:06 -06:00
gnupg wget unzip \
2020-01-28 07:24:02 -06:00
# libcap-dev \
&& apt -qq install --no-install-recommends -y \
2020-04-08 20:53:58 +01:00
python3-dev \
2020-01-28 07:24:02 -06:00
python3-pip \
ffmpeg \
# VAAPI drivers for Intel hardware accel
libva-drm2 libva2 i965-va-driver vainfo \
2020-04-08 20:53:58 +01:00
&& python3 -m pip install -U wheel pip setuptools \
&& python3 -m pip install -U \
2020-01-28 07:24:02 -06:00
opencv-python-headless \
# python-prctl \
numpy \
imutils \
2020-01-31 11:50:42 -05:00
scipy \
2020-04-08 20:53:58 +01:00
&& python3 -m pip install -U \
2020-02-15 21:07:54 -06:00
Flask \
paho-mqtt \
PyYAML \
matplotlib \
pyarrow \
2020-01-05 17:43:14 -06: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 07:24:02 -06:00
libedgetpu1-max \
## Tensorflow lite (python 3.7 only)
2020-04-08 20:53:58 +01:00
&& wget -q https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp36-cp36m-linux_x86_64.whl \
&& python3 -m pip install tflite_runtime-2.1.0.post1-cp36-cp36m-linux_x86_64.whl \
&& rm tflite_runtime-2.1.0.post1-cp36-cp36m-linux_x86_64.whl \
2020-01-05 17:43:14 -06:00
&& rm -rf /var/lib/apt/lists/* \
2020-04-08 20:53:58 +01:00
&& (apt-get autoremove -y; apt-get autoclean -y) \
## Tensorflow
&& python3 -m pip install tensorflow==1.15.2
2019-05-27 10:17:57 -05:00
2020-02-18 05:55:06 -06:00
# get model and labels
RUN wget -q https://github.com/google-coral/edgetpu/raw/master/test_data/mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite -O /edgetpu_model.tflite --trust-server-names
RUN wget -q https://dl.google.com/coral/canned_models/coco_labels.txt -O /labelmap.txt --trust-server-names
2020-04-08 20:53:58 +01:00
RUN wget -q http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_2018_01_28.tar.gz -O /cpu_model.tar.gz && \
tar -xf /cpu_model.tar.gz -C / ssd_mobilenet_v1_coco_2018_01_28/frozen_inference_graph.pb --strip-components 1 && \
mv /frozen_inference_graph.pb /cpu_model.pb && \
rm /cpu_model.tar.gz
2019-02-28 06:49:27 -06:00
WORKDIR /opt/frigate/
ADD frigate frigate/
2019-01-26 08:02:59 -06:00
COPY detect_objects.py .
2020-02-22 08:59:16 -06:00
COPY benchmark.py .
2019-01-26 08:02:59 -06:00
2020-04-08 20:53:58 +01:00
ENV TF_CPP_MIN_LOG_LEVEL 2
CMD ["python3", "-u", "detect_objects.py"]