├── demos ├── videos │ └── .placeholder ├── img │ ├── face-recognition.png │ └── pedestrian-tracker.png ├── pedestrian-tracker │ ├── pedestrian-tracker.sh │ └── Dockerfile ├── face-recognition │ ├── face-recognition.sh │ └── Dockerfile ├── docker-compose.yml └── Readme.md ├── .gitignore ├── img └── car-inference.png ├── sample-app ├── run.sh └── Dockerfile ├── Dockerfile ├── Dockerfile-runtime ├── docker-compose.yml └── README.md /demos/videos/.placeholder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | l_openvino_toolkit_* 2 | -------------------------------------------------------------------------------- /img/car-inference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mateoguzman/openvino-docker/HEAD/img/car-inference.png -------------------------------------------------------------------------------- /demos/img/face-recognition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mateoguzman/openvino-docker/HEAD/demos/img/face-recognition.png -------------------------------------------------------------------------------- /demos/img/pedestrian-tracker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mateoguzman/openvino-docker/HEAD/demos/img/pedestrian-tracker.png -------------------------------------------------------------------------------- /demos/pedestrian-tracker/pedestrian-tracker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VIDEO="${VIDEO:-/app/videos/stairs.mp4}" 4 | 5 | source /opt/intel/openvino/bin/setupvars.sh && \ 6 | /root/omz_demos_build/intel64/Release/pedestrian_tracker_demo \ 7 | -i $VIDEO \ 8 | -m_det /app/models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml \ 9 | -m_reid /app/models/intel/person-reidentification-retail-0031/FP32/person-reidentification-retail-0031.xml \ 10 | -d_det CPU 11 | -------------------------------------------------------------------------------- /demos/face-recognition/face-recognition.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VIDEO="${VIDEO:-/app/videos/video.mp4}" 4 | 5 | source /opt/intel/openvino/bin/setupvars.sh && \ 6 | python3 /opt/intel/openvino/inference_engine/demos/python_demos/face_recognition_demo/face_recognition_demo.py \ 7 | -i $VIDEO \ 8 | -fg /app/images \ 9 | -m_fd /app/models/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.xml \ 10 | -m_lm /app/models/intel/landmarks-regression-retail-0009/FP32/landmarks-regression-retail-0009.xml \ 11 | -m_reid /app/models/intel/face-reidentification-retail-0095/FP32/face-reidentification-retail-0095.xml 12 | 13 | -------------------------------------------------------------------------------- /sample-app/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/inference_engine_demos_build/intel64/Release/lib/ 4 | source /opt/intel/openvino/bin/setupvars.sh && \ 5 | /root/inference_engine_demos_build/intel64/Release/security_barrier_camera_demo \ 6 | -d CPU \ 7 | -d_va CPU \ 8 | -d_lpr CPU \ 9 | -i /opt/intel/openvino/deployment_tools/demo/car_1.bmp \ 10 | -m /root/openvino_models/ir/intel/vehicle-license-plate-detection-barrier-0106/FP16/vehicle-license-plate-detection-barrier-0106.xml \ 11 | -m_lpr /root/openvino_models/ir/intel/license-plate-recognition-barrier-0001/FP16/license-plate-recognition-barrier-0001.xml \ 12 | -m_va /root/openvino_models/ir/intel/vehicle-attributes-recognition-barrier-0039/FP16/vehicle-attributes-recognition-barrier-0039.xml -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | ARG PACKAGE=intel-openvino-dev-ubuntu18-2020.3.194 4 | 5 | RUN apt-get update && apt-get -y upgrade 6 | RUN apt-get install -y --no-install-recommends \ 7 | ca-certificates \ 8 | gnupg \ 9 | wget 10 | 11 | RUN wget https://apt.repos.intel.com/openvino/2020/GPG-PUB-KEY-INTEL-OPENVINO-2020 && \ 12 | apt-key add GPG-PUB-KEY-INTEL-OPENVINO-2020 13 | 14 | RUN echo "deb https://apt.repos.intel.com/openvino/2020 all main" > /etc/apt/sources.list.d/intel-openvino-2020.list 15 | 16 | RUN apt-get update && \ 17 | apt-get install -y --no-install-recommends \ 18 | $PACKAGE && \ 19 | apt autoremove -y && \ 20 | rm -rf /var/lib/apt/lists/* 21 | 22 | RUN /bin/bash -c "source /opt/intel/openvino/bin/setupvars.sh" 23 | 24 | RUN echo "source /opt/intel/openvino/bin/setupvars.sh" >> /root/.bashrc 25 | 26 | CMD ["/bin/bash"] 27 | -------------------------------------------------------------------------------- /Dockerfile-runtime: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | ARG PACKAGE=intel-openvino-runtime-ubuntu18-2020.2.130 4 | 5 | RUN apt-get update && apt-get -y upgrade 6 | RUN apt-get install -y --no-install-recommends \ 7 | ca-certificates \ 8 | gnupg \ 9 | wget 10 | 11 | RUN wget https://apt.repos.intel.com/openvino/2020/GPG-PUB-KEY-INTEL-OPENVINO-2020 && \ 12 | apt-key add GPG-PUB-KEY-INTEL-OPENVINO-2020 13 | 14 | RUN echo "deb https://apt.repos.intel.com/openvino/2020 all main" > /etc/apt/sources.list.d/intel-openvino-2020.list 15 | 16 | RUN apt-get update && \ 17 | apt-get install -y --no-install-recommends \ 18 | $PACKAGE && \ 19 | apt autoremove -y && \ 20 | rm -rf /openvino /var/lib/apt/lists/* 21 | 22 | RUN /bin/bash -c "source /opt/intel/openvino/bin/setupvars.sh" 23 | 24 | RUN echo "source /opt/intel/openvino/bin/setupvars.sh" >> /root/.bashrc 25 | 26 | CMD ["/bin/bash"] 27 | -------------------------------------------------------------------------------- /demos/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.4' 2 | 3 | services: 4 | pedestrian-tracker: 5 | build: 6 | context: ./pedestrian-tracker 7 | dockerfile: Dockerfile 8 | image: pedestrian-tracker-dev 9 | stdin_open: true 10 | tty: true 11 | command: bash /app/pedestrian-tracker.sh 12 | volumes: 13 | - $HOME/.Xauthority:/root/.Xauthority 14 | - ./videos:/app/videos 15 | network_mode: host 16 | devices: 17 | - /dev/video0:/dev/video0 18 | environment: 19 | - DISPLAY 20 | - VIDEO 21 | 22 | face-recognition: 23 | build: 24 | context: ./face-recognition 25 | dockerfile: Dockerfile 26 | image: face-recognition-dev 27 | stdin_open: true 28 | tty: true 29 | command: bash /app/face-recognition.sh 30 | volumes: 31 | - $HOME/.Xauthority:/root/.Xauthority 32 | - ./videos:/app/videos 33 | network_mode: host 34 | devices: 35 | - /dev/video0:/dev/video0 36 | environment: 37 | - DISPLAY 38 | - VIDEO 39 | -------------------------------------------------------------------------------- /demos/pedestrian-tracker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openvino-dev:2020.3.194 2 | 3 | #Install needed dependences 4 | RUN apt-get update && apt-get install -y --no-install-recommends \ 5 | build-essential \ 6 | cmake \ 7 | ffmpeg \ 8 | libgtk-3.0 \ 9 | python3 \ 10 | python3-pip \ 11 | python3-setuptools \ 12 | vim && \ 13 | apt autoremove -y && \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | COPY pedestrian-tracker.sh /app/ 17 | 18 | ## Download needed models 19 | WORKDIR /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader/ 20 | RUN pip3 install -r requirements.in 21 | RUN ./downloader.py --name person-detection-retail-0013 --output_dir /app/models 22 | RUN ./downloader.py --name person-reidentification-retail-0300 --output_dir /app/models 23 | RUN ./downloader.py --name person-reidentification-retail-0031 --output_dir /app/models 24 | 25 | # Build Open Model Zoo demos 26 | RUN /opt/intel/openvino/deployment_tools/open_model_zoo/demos/build_demos.sh 27 | 28 | WORKDIR /app 29 | 30 | CMD ["bash"] 31 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.4' 2 | services: 3 | openvino-dev: 4 | build: 5 | context: . 6 | dockerfile: Dockerfile 7 | image: openvino-dev:2020.3.194 8 | stdin_open: true 9 | tty: true 10 | command: bash 11 | 12 | openvino-runtime: 13 | build: 14 | context: . 15 | dockerfile: Dockerfile-runtime 16 | image: openvino-runtime:2020.3.194 17 | stdin_open: true 18 | tty: true 19 | command: bash 20 | 21 | sampleapp-dev: 22 | build: 23 | context: ./sample-app 24 | dockerfile: Dockerfile 25 | target: sampleapp-dev 26 | image: sampleapp-dev 27 | stdin_open: true 28 | tty: true 29 | command: bash 30 | volumes: 31 | - $HOME/.Xauthority:/root/.Xauthority 32 | network_mode: host 33 | environment: 34 | - DISPLAY 35 | 36 | sampleapp-runtime: 37 | build: 38 | context: ./sample-app 39 | dockerfile: Dockerfile 40 | target: sampleapp-runtime 41 | image: sampleapp-runtime 42 | stdin_open: true 43 | tty: true 44 | command: bash /app/run.sh 45 | volumes: 46 | - $HOME/.Xauthority:/root/.Xauthority 47 | network_mode: host 48 | environment: 49 | - DISPLAY 50 | 51 | -------------------------------------------------------------------------------- /demos/face-recognition/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openvino-dev:2020.3.194 2 | 3 | #Install needed dependences 4 | RUN apt-get update && apt-get install -y --no-install-recommends \ 5 | gstreamer1.0-plugins-base \ 6 | gstreamer1.0-plugins-good \ 7 | gstreamer1.0-plugins-bad \ 8 | ffmpeg \ 9 | libgtk-3.0 \ 10 | libpython3.6 \ 11 | python3 \ 12 | python3-pip \ 13 | python3-setuptools \ 14 | vim && \ 15 | apt autoremove -y && \ 16 | rm -rf /var/lib/apt/lists/* 17 | 18 | COPY face-recognition.sh /app/ 19 | 20 | ## Download needed models 21 | WORKDIR /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader/ 22 | RUN pip3 install -r requirements.in 23 | RUN ./downloader.py --name face-detection-adas-0001 --output_dir /app/models 24 | RUN ./downloader.py --name face-detection-adas-binary-0001 --output_dir /app/models 25 | RUN ./downloader.py --name face-detection-retail-0004 --output_dir /app/models 26 | RUN ./downloader.py --name face-reidentification-retail-0095 --output_dir /app/models 27 | RUN ./downloader.py --name landmarks-regression-retail-0009 --output_dir /app/models 28 | 29 | # Install face recognition python dependencies 30 | 31 | RUN pip3 install -r /opt/intel/openvino/inference_engine/demos/python_demos/face_recognition_demo/requirements.txt 32 | 33 | WORKDIR /app 34 | 35 | CMD ["bash"] 36 | -------------------------------------------------------------------------------- /demos/Readme.md: -------------------------------------------------------------------------------- 1 | # OpenVINO Demos 2 | 3 | OpenVINO includes several [demo applications](https://docs.openvinotoolkit.org/latest/_demos_README.html) that shows how to use the Inference Engine for specific use cases. Here you will find how to run these applications in a Docker Container. 4 | 5 | ## Build the Docker images 6 | 7 | ```bash 8 | docker-compose build 9 | ``` 10 | 11 | This will generate the following images: 12 | 13 | ```bash 14 | face-recognition-dev latest 6012528c8bf8 54 minutes ago 1.44GB 15 | pedestrian-tracker-dev latest fe1bafee0eed About an hour ago 1.39GB 16 | ``` 17 | 18 | ### Pedestrian Tracker C++ Demo 19 | 20 | This demo showcases Pedestrian Tracking scenario: it reads frames from an input video sequence, detects pedestrians in the frames, and builds trajectories of movement of the pedestrians. For more information read the [OpenVINO Pedestrian Tracker documentation.](https://docs.openvinotoolkit.org/latest/_demos_pedestrian_tracker_demo_README.html) 21 | 22 | #### Video 23 | 24 | The demo is expecting a video in video/video.mp4, so you can place your own video or use download the following public video of a mall: 25 | https://www.pexels.com/video/a-day-at-the-mall-1338598/ 26 | 27 | #### Run the sample 28 | 29 | Since this sample application uses the display to show the output, we need to share the host display with the guest container. 30 | 31 | The X server on the host should be enabled for remote connections: 32 | 33 | ```bash 34 | xhost + 35 | ``` 36 | 37 | Now you can run the sample: 38 | 39 | ```bash 40 | docker-compose run -rm pedestrian-tracker 41 | ``` 42 | 43 | The sample should display the video with the detections on it: 44 | 45 | ![Pedestrian Tracker](img/pedestrian-tracker.png) 46 | 47 | #### Customizations 48 | 49 | Note that the container runs the script pedestrian-tracker.sh which executes the demo with a set of arguments: 50 | 51 | ```bash 52 | 53 | VIDEO="${VIDEO:-/app/videos/video.mp4}" 54 | 55 | source /opt/intel/openvino/bin/setupvars.sh && \ 56 | /root/omz_demos_build/intel64/Release/pedestrian_tracker_demo \ 57 | -i $VIDEO \ 58 | -m_det /app/models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml \ 59 | -m_reid /app/models/intel/person-reidentification-retail-0031/FP32/person-reidentification-retail-0031.xml \ 60 | -d_det CPU 61 | ``` 62 | 63 | You can update the video used by setting the VIDEO environment variariable when running the docker-compose: 64 | 65 | ```bash 66 | VIDEO=/app/videos/video1.mp4 docker-compose run pedestrian-tracker 67 | ``` 68 | 69 | You can also point to an online video stream. 70 | 71 | ### Interactive Face Recognition Demo 72 | 73 | This demo uses 3 models to build a pipeline able to detect faces on videos, their keypoints (aka "landkarks"), and recognize persons using the provided faces databases (the gallery) 74 | 75 | For more information read the [OpenVINO Interactive Face Recognition Demo.documentation](https://docs.openvinotoolkit.org/latest/_demos_python_demos_face_recognition_demo_README.html) 76 | 77 | #### Video 78 | 79 | The demo is expecting a video in video/video.mp4, so you can place your own video or use download the following public video of a face: 80 | https://www.pexels.com/video/close-up-of-a-woman-showing-different-facial-expressions-3063839/ 81 | 82 | #### Run the sample 83 | 84 | Since this sample application uses the display to show the output, we need to share the host display with the guest container. 85 | 86 | The X server on the host should be enabled for remote connections: 87 | 88 | ```bash 89 | xhost + 90 | ``` 91 | 92 | Now you can run the sample: 93 | 94 | ```bash 95 | docker-compose run -rm face-recognition 96 | ``` 97 | 98 | The sample should display the video with the detections on it: 99 | 100 | ![Pedestrian Tracker](img/face-recognition.png) 101 | 102 | #### Customizations 103 | 104 | Note that the container runs the script face-recognition.sh which executes the demo with a set of arguments: 105 | 106 | ```bash 107 | 108 | #!/bin/bash 109 | 110 | VIDEO="${VIDEO:-/app/videos/video.mp4}" 111 | 112 | source /opt/intel/openvino/bin/setupvars.sh && \ 113 | python3 /opt/intel/openvino/inference_engine/demos/python_demos/face_recognition_demo/face_recognition_demo.py \ 114 | -i $VIDEO \ 115 | -fg /app/images \ 116 | -m_fd /app/models/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.xml \ 117 | -m_lm /app/models/intel/landmarks-regression-retail-0009/FP32/landmarks-regression-retail-0009.xml \ 118 | -m_reid /app/models/intel/face-reidentification-retail-0095/FP32/face-reidentification-retail-0095.xml 119 | ``` 120 | 121 | You can update the video used by setting the VIDEO environment variariable when running the docker-compose: 122 | 123 | ```bash 124 | VIDEO=/app/videos/video1.mp4 docker-compose run face-recognition 125 | ``` 126 | 127 | You can also point to an online video stream or a webcam using /dev/video0 in the $VIDEO env variable. 128 | ... 129 | 130 | More Demos to come. 131 | -------------------------------------------------------------------------------- /sample-app/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openvino-dev:2020.3.194 as sampleapp-dev 2 | 3 | RUN apt-get update && apt-get install -y --no-install-recommends \ 4 | libgtk-3.0 \ 5 | sudo && \ 6 | apt autoremove -y && \ 7 | rm -rf /var/lib/apt/lists/* 8 | 9 | WORKDIR /opt/intel/openvino/deployment_tools/demo 10 | 11 | RUN ./demo_security_barrier_camera.sh -sample-options -no_show 12 | 13 | RUN ./demo_squeezenet_download_convert_run.sh 14 | 15 | # Generate the deployment package 16 | RUN /opt/intel/openvino/deployment_tools/tools/deployment_manager/deployment_manager.py \ 17 | --targets cpu gpu vpu gna hddl --output_dir /tmp --archive_name openvino_deploy_package 18 | 19 | ## SAMPLEAPP RUNTIME 20 | FROM ubuntu:18.04 as sampleapp-runtime 21 | 22 | # Extract OpenVINO runtime 23 | COPY --from=sampleapp-dev /tmp/openvino_deploy_package.tar.gz /tmp 24 | RUN mkdir -p /opt/intel/openvino && tar zxf /tmp/openvino_deploy_package.tar.gz -C /opt/intel/openvino 25 | 26 | # Copy application binary files 27 | COPY --from=sampleapp-dev /root/inference_engine_demos_build/intel64/Release/ \ 28 | /root/inference_engine_demos_build/intel64/Release 29 | 30 | # Copy Models 31 | COPY --from=sampleapp-dev /root/openvino_models/ir/intel/license-plate-recognition-barrier-0001/FP16 \ 32 | /root/openvino_models/ir/intel/license-plate-recognition-barrier-0001/FP16 33 | COPY --from=sampleapp-dev /root/openvino_models/ir/intel/vehicle-attributes-recognition-barrier-0039/FP16 \ 34 | /root/openvino_models/ir/intel/vehicle-attributes-recognition-barrier-0039/FP16 35 | COPY --from=sampleapp-dev /root/openvino_models/ir/intel/vehicle-license-plate-detection-barrier-0106/FP16 \ 36 | /root/openvino_models/ir/intel/vehicle-license-plate-detection-barrier-0106/FP16 37 | 38 | # Copy Images 39 | COPY --from=sampleapp-dev /opt/intel/openvino/deployment_tools/demo/car_1.bmp \ 40 | /opt/intel/openvino/deployment_tools/demo/car_1.bmp 41 | 42 | COPY --from=sampleapp-dev \ 43 | /lib/x86_64-linux-gnu/libblkid.so.1 \ 44 | /lib/x86_64-linux-gnu/libbsd.so.0 \ 45 | /lib/x86_64-linux-gnu/libc.so.6 \ 46 | /lib/x86_64-linux-gnu/libdbus-1.so.3 \ 47 | /lib/x86_64-linux-gnu/libdl.so.2 \ 48 | /lib/x86_64-linux-gnu/libexpat.so.1 \ 49 | /lib/x86_64-linux-gnu/libgcc_s.so.1 \ 50 | /lib/x86_64-linux-gnu/libgcrypt.so.20 \ 51 | /lib/x86_64-linux-gnu/libgpg-error.so.0 \ 52 | /lib/x86_64-linux-gnu/liblzma.so.5 \ 53 | /lib/x86_64-linux-gnu/libm.so.6 \ 54 | /lib/x86_64-linux-gnu/libmount.so.1 \ 55 | /lib/x86_64-linux-gnu/libpcre.so.3 \ 56 | /lib/x86_64-linux-gnu/libpthread.so.0 \ 57 | /lib/x86_64-linux-gnu/libresolv.so.2 \ 58 | /lib/x86_64-linux-gnu/librt.so.1 \ 59 | /lib/x86_64-linux-gnu/libselinux.so.1 \ 60 | /lib/x86_64-linux-gnu/libsystemd.so.0 \ 61 | /lib/x86_64-linux-gnu/libuuid.so.1 \ 62 | /lib/x86_64-linux-gnu/libz.so.1 \ 63 | /opt/intel/openvino/deployment_tools/inference_engine/external/tbb/lib/libtbb.so.2 \ 64 | /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libinference_engine.so \ 65 | /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libinference_engine_legacy.so \ 66 | /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libinference_engine_transformations.so \ 67 | /opt/intel/openvino/deployment_tools/ngraph/lib/libngraph.so \ 68 | /opt/intel/openvino/opencv/lib/libopencv_core.so.4.3 \ 69 | /opt/intel/openvino/opencv/lib/libopencv_highgui.so.4.3 \ 70 | /opt/intel/openvino/opencv/lib/libopencv_imgcodecs.so.4.3 \ 71 | /opt/intel/openvino/opencv/lib/libopencv_imgproc.so.4.3 \ 72 | /opt/intel/openvino/opencv/lib/libopencv_videoio.so.4.3 \ 73 | /usr/lib/x86_64-linux-gnu/libX11.so.6 \ 74 | /usr/lib/x86_64-linux-gnu/libXau.so.6 \ 75 | /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 \ 76 | /usr/lib/x86_64-linux-gnu/libXcursor.so.1 \ 77 | /usr/lib/x86_64-linux-gnu/libXdamage.so.1 \ 78 | /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 \ 79 | /usr/lib/x86_64-linux-gnu/libXext.so.6 \ 80 | /usr/lib/x86_64-linux-gnu/libXfixes.so.3 \ 81 | /usr/lib/x86_64-linux-gnu/libXi.so.6 \ 82 | /usr/lib/x86_64-linux-gnu/libXinerama.so.1 \ 83 | /usr/lib/x86_64-linux-gnu/libXrandr.so.2 \ 84 | /usr/lib/x86_64-linux-gnu/libXrender.so.1 \ 85 | /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 \ 86 | /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 \ 87 | /usr/lib/x86_64-linux-gnu/libatspi.so.0 \ 88 | /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 \ 89 | /usr/lib/x86_64-linux-gnu/libcairo.so.2 \ 90 | /usr/lib/x86_64-linux-gnu/libdatrie.so.1 \ 91 | /usr/lib/x86_64-linux-gnu/libepoxy.so.0 \ 92 | /usr/lib/x86_64-linux-gnu/libffi.so.6 \ 93 | /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 \ 94 | /usr/lib/x86_64-linux-gnu/libfreetype.so.6 \ 95 | /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 \ 96 | /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 \ 97 | /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 \ 98 | /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 \ 99 | /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 \ 100 | /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 \ 101 | /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 \ 102 | /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 \ 103 | /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 \ 104 | /usr/lib/x86_64-linux-gnu/liblz4.so.1 \ 105 | /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 \ 106 | /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 \ 107 | /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 \ 108 | /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 \ 109 | /usr/lib/x86_64-linux-gnu/libpng16.so.16 \ 110 | /usr/lib/x86_64-linux-gnu/libstdc++.so.6 \ 111 | /usr/lib/x86_64-linux-gnu/libthai.so.0 \ 112 | /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 \ 113 | /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0 \ 114 | /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1 \ 115 | /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 \ 116 | /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 \ 117 | /usr/lib/x86_64-linux-gnu/libxcb.so.1 \ 118 | /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 \ 119 | /root/inference_engine_demos_build/intel64/Release/lib/ 120 | 121 | RUN echo "source /opt/intel/openvino/bin/setupvars.sh" >> /root/.bashrc 122 | 123 | COPY . /app/ 124 | 125 | CMD ["/app/run.sh"] 126 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenVINO Docker 2 | 3 | Collection of Dockerfiles that will provide you with a base environment to build and run your inference models with [Intel® OpenVINO™ Toolkit](https://docs.openvinotoolkit.org/) 4 | 5 | OpenVINO can be installed downloading the installation files from the official web, using the [Docker Hub images](https://hub.docker.com/u/openvino), using YUM or APT packages. 6 | 7 | These Dockerfiles uses the APT package on top of Ubuntu 18.04 8 | 9 | ## Building the Docker Images 10 | 11 | ``` bash 12 | docker-compose build 13 | ``` 14 | 15 | This will build the following images: 16 | 17 | ``` bash 18 | REPOSITORY TAG IMAGE ID CREATED SIZE 19 | sampleapp-runtime latest 199338615d9e 2 minutes ago 375MB 20 | sampleapp-dev latest 99298ab0a7e3 3 minutes ago 1.74GB 21 | openvino-dev 2020.3.194 e1462a646c16 4 minutes ago 710MB 22 | openvino-runtime 2020.3.194 f9b55d3ad15e 5 minutes ago 562MB 23 | ubuntu 18.04 c3c304cb4f22 3 weeks ago 64.2MB 24 | ``` 25 | 26 | * **ubuntu**: is the base image 27 | * **openvino-runtime**: is the runtime OpenVINO image based on APT package *intel-openvino-runtime-ubuntu18-2020 3.194*. Includes the following modules: 28 | 29 | ``` bash 30 | Depends: intel-openvino-docs-2020.3.194 31 | Depends: intel-openvino-eula-2020.3.194 32 | Depends: intel-openvino-gstreamer-rt-ubuntu-bionic-2020.3.194 33 | Depends: intel-openvino-gva-rt-ubuntu-bionic-2020.3.194 34 | Depends: intel-openvino-ie-rt-2020.3.194 35 | Depends: intel-openvino-ie-rt-core-ubuntu-bionic-2020.3.194 36 | Depends: intel-openvino-ie-rt-cpu-ubuntu-bionic-2020.3.194 37 | Depends: intel-openvino-ie-rt-gna-ubuntu-bionic-2020.3.194 38 | Depends: intel-openvino-ie-rt-gpu-ubuntu-bionic-2020.3.194 39 | Depends: intel-openvino-ie-rt-hddl-ubuntu-bionic-2020.3.194 40 | Depends: intel-openvino-ie-rt-vpu-ubuntu-bionic-2020.3.194 41 | Depends: intel-openvino-ie-sdk-ubuntu-bionic-2020.3.194 42 | Depends: intel-openvino-opencv-generic-2020.3.194 43 | Depends: intel-openvino-opencv-lib-ubuntu-bionic-2020.3.194 44 | Depends: intel-openvino-setupvars-2020.3.194 45 | ``` 46 | 47 | * **openvino-dev**: is the development OpenVINO image including all the components and based on APT package *intel-openvino-dev-ubuntu18-2020.3.194*. Inludes the *openvino-runtime* modules with the addition of: 48 | 49 | ``` bash 50 | Depends: intel-openvino-dl-workbench-2020.3.194 51 | Depends: intel-openvino-gva-dev-ubuntu-bionic-2020.3.194 52 | Depends: intel-openvino-gva-sdk-2020.3.194 53 | Depends: intel-openvino-ie-bin-python-tools-ubuntu-bionic-2020.3.194 54 | Depends: intel-openvino-ie-samples-2020.3.194 55 | Depends: intel-openvino-model-optimizer-2020.3.194 56 | Depends: intel-openvino-omz-dev-2020.3.194 57 | Depends: intel-openvino-omz-tools-2020.3.194 58 | Depends: intel-openvino-opencv-etc-2020.3.194 59 | Depends: intel-openvino-pot-2020.3.194 60 | ``` 61 | 62 | * **sampleapp**: is a sample application using the OpenVINO Toolkig. 63 | 64 | ## Using the image 65 | 66 | ### Run a sample application 67 | 68 | We will run the [security barrier demo](https://docs.openvinotoolkit.org/2020.2/_demos_security_barrier_camera_demo_README.html) included with OpenVINO, in a separate container. 69 | 70 | ``` bash 71 | docker-compose run sampleapp-runtime 72 | ``` 73 | 74 | The inference output should be visible in the terminal: 75 | 76 | ``` bash 77 | $ docker-compose run sampleapp-runtime 78 | [setupvars.sh] OpenVINO environment initialized 79 | [ INFO ] InferenceEngine: 0x7f8c44aaf030 80 | [ INFO ] Files were added: 1 81 | [ INFO ] /opt/intel/openvino/deployment_tools/demo/car_1.bmp 82 | [ INFO ] Loading device CPU 83 | CPU 84 | MKLDNNPlugin version ......... 2.1 85 | Build ........... 42025 86 | 87 | [ INFO ] Loading detection model to the CPU plugin 88 | [ INFO ] Loading Vehicle Attribs model to the CPU plugin 89 | [ INFO ] Loading Licence Plate Recognition (LPR) model to the CPU plugin 90 | [ INFO ] Number of InferRequests: 1 (detection), 3 (classification), 3 (recognition) 91 | [ INFO ] 4 streams for CPU 92 | [ INFO ] Display resolution: 1920x1080 93 | [ INFO ] Number of allocated frames: 3 94 | [ INFO ] Resizable input with support of ROI crop and auto resize is disabled 95 | Invalid MIT-MAGIC-COOKIE-1 keyUnable to init server: Could not connect: Connection refused 96 | 97 | (Detection results:13): Gtk-WARNING **: 08:35:06.722: cannot open display: :0 98 | 99 | ``` 100 | 101 | ### Run the the container with X enabled (Linux) 102 | 103 | This sample uses OpenCV to desplay the resulting frame with detections rendered as bounding boxes and text. For running a sample application that displays an image, you need to share the host display to be accessed from guest Docker container. 104 | 105 | First the X server on the host should be enabled for remote connections (note that this turns off access control): 106 | 107 | ``` bash 108 | xhost + 109 | ``` 110 | 111 | The following flags needs to be added to the docker run command: 112 | 113 | * --net=host 114 | * --env="DISPLAY" 115 | * --volume="$HOME/.Xauthority:/root/.Xauthority:rw" 116 | 117 | This is already added in the docker-compose.yml: 118 | 119 | ``` bash 120 | volumes: 121 | - $HOME/.Xauthority:/root/.Xauthority 122 | network_mode: host 123 | environment: 124 | - DISPLAY 125 | ``` 126 | 127 | Now, run again the sample app and you will see the screen output 128 | 129 | ![Inrefence](./img/car-inference.png) 130 | 131 | When finished, disable the remote connections to the X server 132 | 133 | ``` bash 134 | xhost - 135 | ``` 136 | 137 | ### Use the image in another container 138 | 139 | You can use this Docker image as a base image and use it in multiple Dockerfiles. Use multi-stage with *openvino-dev* and/or *openvino-runtime* image in your Dockerfile. 140 | 141 | In general, openvino-dev would be used when using: 142 | 143 | * Deep Learning Workbench 144 | * Gstreamer Video Analytics development and SDK 145 | * Infrence Engine Python tools and Samples 146 | * Model Optimizer 147 | * OpenVINO Model Zoo Tools 148 | * Intel® Post Training Optimization Tool 149 | 150 | Otherwise, openvino-runtime may be used 151 | 152 | ``` bash 153 | ## Development build 154 | FROM openvino-dev:2020.3.194 as sampleapp-dev 155 | 156 | RUN 157 | RUN 158 | 159 | ## Runtime Build 160 | 161 | FROM ubuntu:18.04 162 | 163 | COPY --from=sampleapp-dev 164 | COPY --from=sampleapp-dev 165 | 166 | CMD ["/myapp"] 167 | ``` 168 | 169 | An example of this process is shown in sample-app folder 170 | --------------------------------------------------------------------------------