Dockerfile 2.3 KB

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