Dockerfile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. FROM debian:buster-slim
  2. LABEL maintainer "blakeb@blakeshome.com"
  3. ENV DEBIAN_FRONTEND=noninteractive
  4. # Install packages for apt repo
  5. RUN apt -qq update && apt -qq install --no-install-recommends -y \
  6. gnupg wget \
  7. ffmpeg \
  8. python3 \
  9. python3-pip \
  10. # python-prctl
  11. build-essential libcap-dev \
  12. # pillow-simd
  13. zlib1g-dev libjpeg-dev python3-dev\
  14. # VAAPI drivers for Intel hardware accel
  15. libva-drm2 libva2 i965-va-driver vainfo \
  16. && echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
  17. && wget -q -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
  18. && apt -qq update \
  19. && echo "libedgetpu1-max libedgetpu/accepted-eula boolean true" | debconf-set-selections \
  20. && apt -qq install --no-install-recommends -y \
  21. libedgetpu1-max \
  22. python3-edgetpu \
  23. && rm -rf /var/lib/apt/lists/* \
  24. && (apt-get autoremove -y; apt-get autoclean -y)
  25. # needs to be installed before others
  26. RUN pip3 install -U wheel setuptools
  27. RUN pip3 install -U \
  28. opencv-python \
  29. python-prctl \
  30. numpy \
  31. Flask \
  32. paho-mqtt \
  33. PyYAML \
  34. matplotlib \
  35. scipy \
  36. pillow-simd
  37. # symlink the model and labels
  38. 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
  39. RUN wget -q https://dl.google.com/coral/canned_models/coco_labels.txt -O coco_labels.txt --trust-server-names
  40. RUN ln -s mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite /frozen_inference_graph.pb
  41. RUN ln -s /coco_labels.txt /label_map.pbtext
  42. WORKDIR /opt/frigate/
  43. ADD frigate frigate/
  44. COPY detect_objects.py .
  45. COPY benchmark.py .
  46. CMD ["python3", "-u", "detect_objects.py"]