You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

multi-edge-inference-pedestrian-tracking-gpu-videoanalytics.Dockerfile 3.3 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. FROM pytorch/pytorch:1.8.1-cuda10.2-cudnn7-devel
  2. WORKDIR /home
  3. RUN apt update -o Acquire::https::developer.download.nvidia.com::Verify-Peer=false
  4. # Required by OpenCV
  5. RUN apt install libgl1 libglx-mesa0 libgl1-mesa-glx -y
  6. RUN apt install -y gfortran libopenblas-dev liblapack-dev
  7. # Update Python
  8. RUN apt install python3.8 python3.8-distutils python3-venv curl -y
  9. RUN python3.8 --version
  10. RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  11. RUN python3.8 get-pip.py
  12. ######################################################
  13. # Install OpenCV manually with gstreamer support #
  14. ######################################################
  15. ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London"
  16. RUN apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev \
  17. gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
  18. gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools \
  19. gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 \
  20. gstreamer1.0-pulseaudio -y
  21. RUN apt install ubuntu-restricted-extras wget ca-certificates -y
  22. RUN wget -k --no-check-certificate https://github.com/opencv/opencv/archive/4.5.5.zip -O opencv.zip
  23. RUN apt install unzip cmake -y
  24. RUN wget -k --no-check-certificate https://github.com/opencv/opencv_contrib/archive/4.5.5.zip -O opencv_contrib.zip
  25. RUN unzip opencv.zip
  26. RUN unzip opencv_contrib.zip
  27. RUN ls -la
  28. RUN pwd
  29. WORKDIR opencv-4.5.5
  30. RUN mkdir build
  31. WORKDIR build
  32. RUN cmake -D CMAKE_BUILD_TYPE=RELEASE \
  33. -D INSTALL_PYTHON_EXAMPLES=OFF \
  34. -D INSTALL_C_EXAMPLES=OFF \
  35. -D PYTHON_EXECUTABLE=$(which python3) \
  36. -D BUILD_opencv_python2=OFF \
  37. -D OPENCV_EXTRA_MODULES_PATH=/home/opencv_contrib-4.5.5/modules \
  38. -D WITH_CUDA=ON \
  39. -D WITH_CUDNN=OFF\
  40. -D OPENCV_DNN_CUDA=ON\
  41. -D ENABLE_FAST_MATH=1\
  42. -D CUDA_FAST_MATH=1\
  43. -D CUDA_ARCH_BIN=6.0\
  44. -D WITH_CUBLAS=1 \
  45. -D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") \
  46. -D PYTHON3_EXECUTABLE=$(which python3) \
  47. -D PYTHON3_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
  48. -D PYTHON3_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
  49. -D WITH_GSTREAMER=ON \
  50. -D BUILD_TIFF=ON \
  51. -D BUILD_JPEG=ON \
  52. -D WITH_JPEG=ON \
  53. -D BUILD_EXAMPLES=OFF ..
  54. RUN make -j6
  55. RUN make install
  56. RUN ldconfig
  57. ## Install applications dependencies
  58. RUN pip install tqdm pillow pytorch-ignite asyncio --trusted-host=developer.download.nvidia.com
  59. ## Add Kafka Python library
  60. RUN pip install kafka-python --trusted-host=developer.download.nvidia.com
  61. ## Add tracking dependencies
  62. RUN pip install lap scipy Cython --trusted-host=developer.download.nvidia.com
  63. RUN pip install cython_bbox --trusted-host=developer.download.nvidia.com
  64. ## SEDNA SECTION ##
  65. COPY ./lib/requirements.txt /home
  66. RUN pip install -r /home/requirements.txt --trusted-host=developer.download.nvidia.com
  67. ENV PYTHONPATH "${PYTHONPATH}:/home/lib"
  68. # OpenCV
  69. RUN apt install libglib2.0-0 -y
  70. ## Install S3 library
  71. RUN pip install boto3
  72. # ONNX
  73. RUN pip install onnx protobuf==3.16.0
  74. WORKDIR /home/work
  75. COPY ./lib /home/lib
  76. COPY examples/multiedgeinference/pedestrian_tracking/detection/ /home/work/
  77. ENV LOG_LEVEL="INFO"
  78. ENTRYPOINT ["python"]
  79. CMD ["worker.py"]