Dockerfile.base 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ARG ARCH=amd64
  2. FROM blakeblackshear/frigate-wheels:${ARCH} as wheels
  3. FROM blakeblackshear/frigate-ffmpeg:${ARCH} as ffmpeg
  4. FROM ubuntu:20.04
  5. LABEL maintainer "blakeb@blakeshome.com"
  6. COPY --from=ffmpeg /usr/local /usr/local/
  7. COPY --from=wheels /wheels/. /wheels/
  8. ENV DEBIAN_FRONTEND=noninteractive
  9. # Install packages for apt repo
  10. RUN apt-get -qq update && apt-get -qq install --no-install-recommends -y \
  11. gnupg wget unzip tzdata \
  12. && apt-get -qq install --no-install-recommends -y \
  13. python3-pip \
  14. && pip3 install -U /wheels/*.whl \
  15. && APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn apt-key adv --fetch-keys https://packages.cloud.google.com/apt/doc/apt-key.gpg \
  16. && echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
  17. && echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections \
  18. && apt-get -qq update && apt-get -qq install --no-install-recommends -y \
  19. libedgetpu1-max \
  20. && rm -rf /var/lib/apt/lists/* /wheels \
  21. && (apt-get autoremove -y; apt-get autoclean -y)
  22. # get model and labels
  23. ARG MODEL_REFS=7064b94dd5b996189242320359dbab8b52c94a84
  24. COPY labelmap.txt /labelmap.txt
  25. RUN wget -q https://github.com/google-coral/edgetpu/raw/$MODEL_REFS/test_data/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite -O /edgetpu_model.tflite
  26. RUN wget -q https://github.com/google-coral/edgetpu/raw/$MODEL_REFS/test_data/ssd_mobilenet_v2_coco_quant_postprocess.tflite -O /cpu_model.tflite
  27. RUN mkdir /cache /clips
  28. WORKDIR /opt/frigate/
  29. ADD frigate frigate/
  30. COPY detect_objects.py .
  31. COPY benchmark.py .
  32. COPY process_clip.py .
  33. CMD ["python3", "-u", "detect_objects.py"]