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. python3-dev \
  11. python3-numpy \
  12. # python-prctl
  13. build-essential libcap-dev \
  14. # pillow-simd
  15. # zlib1g-dev libjpeg-dev \
  16. # VAAPI drivers for Intel hardware accel
  17. libva-drm2 libva2 i965-va-driver vainfo \
  18. && echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
  19. && wget -q -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
  20. && apt -qq update \
  21. && echo "libedgetpu1-max libedgetpu/accepted-eula boolean true" | debconf-set-selections \
  22. && apt -qq install --no-install-recommends -y \
  23. libedgetpu1-max \
  24. python3-edgetpu \
  25. && rm -rf /var/lib/apt/lists/* \
  26. && (apt-get autoremove -y; apt-get autoclean -y)
  27. # needs to be installed before others
  28. RUN pip3 install -U wheel setuptools
  29. RUN pip3 install -U \
  30. opencv-python \
  31. python-prctl \
  32. Flask \
  33. paho-mqtt \
  34. PyYAML \
  35. matplotlib \
  36. scipy
  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"]