Dockerfile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. FROM ubuntu:20.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. software-properties-common \
  7. # apt-transport-https ca-certificates \
  8. build-essential \
  9. gnupg wget unzip tzdata \
  10. # libcap-dev \
  11. && add-apt-repository ppa:deadsnakes/ppa -y \
  12. && apt -qq install --no-install-recommends -y \
  13. python3.8 \
  14. python3.8-dev \
  15. python3-pip \
  16. ffmpeg \
  17. # VAAPI drivers for Intel hardware accel
  18. libva-drm2 libva2 i965-va-driver vainfo \
  19. && python3.8 -m pip install -U pip \
  20. && python3.8 -m pip install -U wheel setuptools \
  21. && python3.8 -m pip install -U \
  22. opencv-python-headless \
  23. # python-prctl \
  24. numpy \
  25. imutils \
  26. scipy \
  27. psutil \
  28. && python3.8 -m pip install -U \
  29. Flask \
  30. paho-mqtt \
  31. PyYAML \
  32. matplotlib \
  33. click \
  34. && echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
  35. && wget -q -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
  36. && apt -qq update \
  37. && echo "libedgetpu1-max libedgetpu/accepted-eula boolean true" | debconf-set-selections \
  38. && apt -qq install --no-install-recommends -y \
  39. libedgetpu1-max \
  40. ## Tensorflow lite
  41. && wget -q https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp38-cp38-linux_x86_64.whl \
  42. && python3.8 -m pip install tflite_runtime-2.1.0.post1-cp38-cp38-linux_x86_64.whl \
  43. && rm tflite_runtime-2.1.0.post1-cp38-cp38-linux_x86_64.whl \
  44. && rm -rf /var/lib/apt/lists/* \
  45. && (apt-get autoremove -y; apt-get autoclean -y)
  46. # get model and labels
  47. RUN wget -q https://github.com/google-coral/edgetpu/raw/master/test_data/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite -O /edgetpu_model.tflite --trust-server-names
  48. COPY labelmap.txt /labelmap.txt
  49. RUN wget -q https://github.com/google-coral/edgetpu/raw/master/test_data/ssd_mobilenet_v2_coco_quant_postprocess.tflite -O /cpu_model.tflite
  50. RUN mkdir /cache /clips
  51. WORKDIR /opt/frigate/
  52. ADD frigate frigate/
  53. COPY detect_objects.py .
  54. COPY benchmark.py .
  55. COPY process_clip.py .
  56. CMD ["python3.8", "-u", "detect_objects.py"]