Dockerfile 1.8 KB

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