Docker opencvino 教程

Docker opencvino教程

首先,确保你已经安装了docke。

1. 使用指令搜索openvino

# 本地镜像
docker images

# 搜索openvino docker镜像
[root@abc123 /]# docker search openvino
NAME                                                 DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
openvino/workbench                                   OpenVINO™ DL Workbench is a web GUI to simpl…   10
intelaipg/openvino-model-server                      OpenVINO Model Server [DEPRECATED] Please us…   8
openvino/ubuntu18_runtime                            Intel® Distribution of OpenVINO™ toolkit Doc…   6
openvino/ubuntu18_dev                                Intel® Distribution of OpenVINO™ toolkit Doc…   5
cortexica/openvino                                   Ubuntu 18.04 image with Intel OpenVINO depen…   4                    [OK]
kuberlab/openvino                                                                                    1
openvino/model_server                                Intel® Distribution of OpenVINO™ Model Serve…   1
openvino/ubuntu20_runtime                            Intel® Distribution of OpenVINO™ toolkit Doc…   1
openvinoincluit/openvino                             Ubuntu 16.04 + OpenVINO toolkit docker image    1
clearlinux/openvino                                  OpenVino base container image with the benef…   1
openvino/ubuntu18_model_server                       [DEPRECATED] Please use openvino/model_serve…   0
openvino/ubuntu18_data_dev                           Intel® Distribution of OpenVINO™ toolkit Doc…   0
never2die/openvino_cpu_app                           OpenVINO CPU sample application                 0
aleksandronepanelio/openvino.dextr                                                                   0
edgeworx/openvino-camera-ai                                                                          0
aleksandronepanelio/openvino.omz.public.yolo-v3-tf                                                   0
daisukeiot/openvino-container                                                                        0
leixia1/openvino                                     openvino docker images                          0
openvino/centos7_runtime                             Intel® Distribution of OpenVINO™ toolkit Doc…   0
openvinodevosdk/basic                                openvino toolkit and devo sdk                   0
dheni/openvino                                       openvino image for face recognition             0
iotgvmc/openvino                                                                                     0
nrandell/openvino-dotnet-core-runtime                                                                0
hal9zillion/openvino                                 Dockerised Intel Openvino Environment           0
aschu/openvino                                       Ubuntu 16.04 with Intel OpenVino toolkit ins…   0

2. 下载镜像

推荐下载:openvino/ubuntu18_dev, 这个是完整的openvino,

openvino/ubuntu18_runtime不包含open_model_zoo和model_optimizer.

docker pull openvino/ubuntu18_dev
# 或者直接运行
docker run -it -u 0 --rm openvino/ubuntu18_dev /bin/bash  # 会自动下载

3. 运行demo

docker openvino无需安装,可直接使用,非常赞

3.1 但必须安装一下linux指令
apt-get update
apt-get install sudo
apt-get install vim
apt-get instll tree  # 演示必要
3.2 进入镜像
docker run -it -u 0 --rm openvino/ubuntu18_dev /bin/bash 
root@e435a63279f8:/opt/intel/openvino_2021.2.185# pwd
/opt/intel/openvino_2021.2.185   # openvino已经直接安装好了

root@e435a63279f8:/opt/intel/openvino_2021.2.185# tree -L 2
.
|-- bin
|   `-- setupvars.sh
|-- deployment_tools
|   |-- demo            # demo路径
|   |-- inference_engine
|   |-- intel_models -> open_model_zoo/models/intel
|   |-- model_optimizer
|   |-- ngraph
|   |-- open_model_zoo  # demo源代码
|   `-- tools
|-- documentation
|   |-- OpenVINO-GetStarted-Linux-online.html
|   |-- OpenVINO-Install-Linux-online.html
|   |-- OpenVINO-OpenCV-documentation.html
|   `-- OpenVINO-documentation-online.html
|-- inference_engine -> deployment_tools/inference_engine
|-- install_dependencies
|   |-- install_NCS_udev_rules.sh
|   |-- install_NEO_OCL_driver.sh
|   |-- install_guide.html
|   |-- install_openvino_dependencies.sh
|   |-- neo_centos_19.41.14441.sum
|   `-- neo_centos_20.35.17767.sum
|-- licensing
|   |-- EULA.rtf
|   |-- EULA.txt
|   |-- OpenVINOsupport.txt
|   |-- deployment_tools
|   |-- install_dependencies
|   |-- opencv
|   |-- openvx
|   `-- readme.txt
|-- opencv
|   |-- bin
|   |-- build_params.txt
|   |-- cmake
|   |-- etc
|   |-- include
|   |-- lib
|   |-- samples
|   |-- setupvars.sh
|   |-- third-party-programs.txt
|   `-- version.txt
`-- python
    |-- python3
    |-- python3.6
    |-- python3.7
    `-- requirements.txt

28 directories, 20 files

3.3 进入demo路径
root@e435a63279f8:/opt/intel/openvino_2021.2.185# ls
bin  deployment_tools  documentation  inference_engine  install_dependencies  licensing  opencv  python
root@e435a63279f8:/opt/intel/openvino_2021.2.185# cd deployment_tools/
root@e435a63279f8:/opt/intel/openvino_2021.2.185/deployment_tools# ls
demo  inference_engine  intel_models  model_optimizer  ngraph  open_model_zoo  tools
root@e435a63279f8:/opt/intel/openvino_2021.2.185/deployment_tools# cd demo
root@e435a63279f8:/opt/intel/openvino_2021.2.185/deployment_tools/demo# ls
README.txt  demo_benchmark_app.sh              demo_squeezenet_download_convert_run.sh  utils.sh
car.png     demo_security_barrier_camera.conf  output
car_1.bmp   demo_security_barrier_camera.sh    squeezenet1.1.labels
root@e435a63279f8:/opt/intel/openvino_2021.2.185/deployment_tools/demo#
root@e435a63279f8: ./demo_security_barrier_camera.sh -d CPU -sample-options -no_show

# -d CPU : CPU执行
# -no_show: docker后端无法显示图片,否则报错,也可以修改跑open_model_zoo源文件
3.4 结果

由于网络原因,一般下载吗,偶像会很慢,可以将预先下载好的模型放入容器中:

 Ctrl+P+Q  #后台退出容器
 docker cp (/path/to/model)/openvino_models/ e435a63279f8:/root

执行:

root@e435a63279f8:/opt/intel/openvino_2021.2.185/deployment_tools/demo# ./demo_security_barrier_camera.sh -d CPU -sample-options -no_show
target = CPU
sample-options = -no_show
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://archive.canonical.com/ubuntu bionic InRelease
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Fetched 252 kB in 3s (80.4 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
15 packages can be upgraded. Run 'apt list --upgradable' to see them.
Run sudo -E apt -y install build-essential python3-pip virtualenv cmake libcairo2-dev libpango1.0-dev libglib2.0-dev libgtk2.0-dev libswscale-dev libavcodec-dev libavformat-dev libgstreamer1.0-0 gstreamer1.0-plugins-base

Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
libgtk2.0-dev is already the newest version (2.24.32-1ubuntu1).
virtualenv is already the newest version (15.1.0+ds-1.1).
cmake is already the newest version (3.10.2-1ubuntu2.18.04.1).
gstreamer1.0-plugins-base is already the newest version (1.14.5-0ubuntu1~18.04.1).
libcairo2-dev is already the newest version (1.15.10-2ubuntu0.1).
libglib2.0-dev is already the newest version (2.56.4-0ubuntu0.18.04.6).
libgstreamer1.0-0 is already the newest version (1.14.5-0ubuntu1~18.04.1).
libpango1.0-dev is already the newest version (1.40.14-1ubuntu0.1).
libavcodec-dev is already the newest version (7:3.4.8-0ubuntu0.2).
libavformat-dev is already the newest version (7:3.4.8-0ubuntu0.2).
libswscale-dev is already the newest version (7:3.4.8-0ubuntu0.2).
python3-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.4).
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpng-dev is already the newest version (1.6.34-1ubuntu0.18.04.2).
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
Requirement already satisfied: pyyaml in /usr/local/lib/python3.6/dist-packages (from -r /opt/intel/openvino_2021.2.185/deployment_tools/demo/../open_model_zoo/tools/downloader/requirements.in (line 1)) (5.3.1)
Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from -r /opt/intel/openvino_2021.2.185/deployment_tools/demo/../open_model_zoo/tools/downloader/requirements.in (line 2)) (2.25.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests->-r /opt/intel/openvino_2021.2.185/deployment_tools/demo/../open_model_zoo/tools/downloader/requirements.in (line 2)) (1.26.2)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests->-r /opt/intel/openvino_2021.2.185/deployment_tools/demo/../open_model_zoo/tools/downloader/requirements.in (line 2)) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests->-r /opt/intel/openvino_2021.2.185/deployment_tools/demo/../open_model_zoo/tools/downloader/requirements.in (line 2)) (2020.12.5)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests->-r /opt/intel/openvino_2021.2.185/deployment_tools/demo/../open_model_zoo/tools/downloader/requirements.in (line 2)) (4.0.0)
WARNING: You are using pip version 20.3.3; however, version 21.0 is available.
You should consider upgrading via the '/usr/bin/python3.6 -m pip install --upgrade pip' command.
[setupvars.sh] OpenVINO environment initialized


###################################################

Downloading Intel models

target_precision = FP16
Run python3 /opt/intel/openvino_2021.2.185/deployment_tools/open_model_zoo/tools/downloader/downloader.py --name vehicle-license-plate-detection-barrier-0106 --output_dir /root/openvino_models/ir --cache_dir /root/openvino_models/cache

################|| Downloading vehicle-license-plate-detection-barrier-0106 ||################

========== Retrieving /root/openvino_models/ir/intel/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.xml from the cache

========== Retrieving /root/openvino_models/ir/intel/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.bin from the cache

========== Retrieving /root/openvino_models/ir/intel/vehicle-license-plate-detection-barrier-0106/FP16/vehicle-license-plate-detection-barrier-0106.xml from the cache

========== Retrieving /root/openvino_models/ir/intel/vehicle-license-plate-detection-barrier-0106/FP16/vehicle-license-plate-detection-barrier-0106.bin from the cache

========== Retrieving /root/openvino_models/ir/intel/vehicle-license-plate-detection-barrier-0106/FP16-INT8/vehicle-license-plate-detection-barrier-0106.xml from the cache

========== Retrieving /root/openvino_models/ir/intel/vehicle-license-plate-detection-barrier-0106/FP16-INT8/vehicle-license-plate-detection-barrier-0106.bin from the cache

Run python3 /opt/intel/openvino_2021.2.185/deployment_tools/open_model_zoo/tools/downloader/downloader.py --name license-plate-recognition-barrier-0001 --output_dir /root/openvino_models/ir --cache_dir /root/openvino_models/cache

################|| Downloading license-plate-recognition-barrier-0001 ||################

========== Retrieving /root/openvino_models/ir/intel/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.xml from the cache

========== Retrieving /root/openvino_models/ir/intel/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.bin from the cache

========== Retrieving /root/openvino_models/ir/intel/license-plate-recognition-barrier-0001/FP16/license-plate-recognition-barrier-0001.xml from the cache

========== Retrieving /root/openvino_models/ir/intel/license-plate-recognition-barrier-0001/FP16/license-plate-recognition-barrier-0001.bin from the cache

========== Retrieving /root/openvino_models/ir/intel/license-plate-recognition-barrier-0001/FP16-INT8/license-plate-recognition-barrier-0001.xml from the cache

========== Retrieving /root/openvino_models/ir/intel/license-plate-recognition-barrier-0001/FP16-INT8/license-plate-recognition-barrier-0001.bin from the cache

Run python3 /opt/intel/openvino_2021.2.185/deployment_tools/open_model_zoo/tools/downloader/downloader.py --name vehicle-attributes-recognition-barrier-0039 --output_dir /root/openvino_models/ir --cache_dir /root/openvino_models/cache

################|| Downloading vehicle-attributes-recognition-barrier-0039 ||################

========== Retrieving /root/openvino_models/ir/intel/vehicle-attributes-recognition-barrier-0039/FP32/vehicle-attributes-recognition-barrier-0039.xml from the cache

========== Retrieving /root/openvino_models/ir/intel/vehicle-attributes-recognition-barrier-0039/FP32/vehicle-attributes-recognition-barrier-0039.bin from the cache

========== Retrieving /root/openvino_models/ir/intel/vehicle-attributes-recognition-barrier-0039/FP16/vehicle-attributes-recognition-barrier-0039.xml from the cache

========== Retrieving /root/openvino_models/ir/intel/vehicle-attributes-recognition-barrier-0039/FP16/vehicle-attributes-recognition-barrier-0039.bin from the cache

========== Retrieving /root/openvino_models/ir/intel/vehicle-attributes-recognition-barrier-0039/FP16-INT8/vehicle-attributes-recognition-barrier-0039.xml from the cache

========== Retrieving /root/openvino_models/ir/intel/vehicle-attributes-recognition-barrier-0039/FP16-INT8/vehicle-attributes-recognition-barrier-0039.bin from the cache



###################################################

Build Inference Engine demos

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include unistd.h
-- Looking for C++ include unistd.h - found
-- Looking for C++ include stdint.h
-- Looking for C++ include stdint.h - found
-- Looking for C++ include sys/types.h
-- Looking for C++ include sys/types.h - found
-- Looking for C++ include fnmatch.h
-- Looking for C++ include fnmatch.h - found
-- Looking for C++ include stddef.h
-- Looking for C++ include stddef.h - found
-- Check size of uint32_t
-- Check size of uint32_t - done
-- Looking for strtoll
-- Looking for strtoll - found
-- Found InferenceEngine: /opt/intel/openvino_2021.2.185/deployment_tools/inference_engine/lib/intel64/libinference_engine.so (Required is at least version "2.0")
-- Found OpenCV: /opt/intel/openvino_2021.2.185/opencv (found version "4.5.1") found components: core imgcodecs videoio
-- Found OpenCV: /opt/intel/openvino_2021.2.185/opencv (found version "4.5.1") found components: core imgproc
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /root/inference_engine_demos_build
Scanning dependencies of target gflags_nothreads_static
Scanning dependencies of target monitors
[  7%] Building CXX object thirdparty/gflags/CMakeFiles/gflags_nothreads_static.dir/src/gflags.cc.o
[ 21%] Building CXX object thirdparty/gflags/CMakeFiles/gflags_nothreads_static.dir/src/gflags_reporting.cc.o
[ 21%] Building CXX object thirdparty/gflags/CMakeFiles/gflags_nothreads_static.dir/src/gflags_completions.cc.o
[ 28%] Building CXX object common/monitors/CMakeFiles/monitors.dir/src/cpu_monitor.cpp.o
[ 42%] Building CXX object common/monitors/CMakeFiles/monitors.dir/src/memory_monitor.cpp.o
[ 42%] Building CXX object common/monitors/CMakeFiles/monitors.dir/src/presenter.cpp.o
[ 50%] Linking CXX static library ../../intel64/Release/lib/libgflags_nothreads.a
[ 50%] Built target gflags_nothreads_static
Scanning dependencies of target common
[ 57%] Building CXX object common/CMakeFiles/common.dir/src/performance_metrics.cpp.o
[ 64%] Building CXX object common/CMakeFiles/common.dir/src/images_capture.cpp.o
[ 71%] Building CXX object common/CMakeFiles/common.dir/src/args_helper.cpp.o
[ 78%] Linking CXX static library ../../intel64/Release/lib/libmonitors.a
[ 78%] Built target monitors
[ 85%] Linking CXX static library ../intel64/Release/lib/libcommon.a
[ 85%] Built target common
Scanning dependencies of target security_barrier_camera_demo
[ 92%] Building CXX object security_barrier_camera_demo/CMakeFiles/security_barrier_camera_demo.dir/main.cpp.o
[100%] Linking CXX executable ../intel64/Release/security_barrier_camera_demo
[100%] Built target security_barrier_camera_demo


###################################################

Run Inference Engine security_barrier_camera demo

Run ./security_barrier_camera_demo -d CPU -d_va CPU -d_lpr CPU -i /opt/intel/openvino_2021.2.185/deployment_tools/demo/car_1.bmp -m /root/openvino_models/ir/intel/vehicle-license-plate-detection-barrier-0106/FP16/vehicle-license-plate-detection-barrier-0106.xml -m_lpr /root/openvino_models/ir/intel/license-plate-recognition-barrier-0001/FP16/license-plate-recognition-barrier-0001.xml -m_va /root/openvino_models/ir/intel/vehicle-attributes-recognition-barrier-0039/FP16/vehicle-attributes-recognition-barrier-0039.xml -no_show

[ INFO ] InferenceEngine:       API version ......... 2.1
        Build ........... 2021.2.0-1877-176bdf51370-releases/2021/2
[ INFO ] Files were added: 1
[ INFO ]     /opt/intel/openvino_2021.2.185/deployment_tools/demo/car_1.bmp
[ INFO ] Loading device CPU
[ INFO ]        CPU
        MKLDNNPlugin version ......... 2.1
        Build ........... 2021.2.0-1877-176bdf51370-releases/2021/2

[ INFO ] Loading detection model to the CPU plugin
[ INFO ] Loading Vehicle Attribs model to the CPU plugin
[ INFO ] Loading Licence Plate Recognition (LPR) model to the CPU plugin
[ INFO ] Number of InferRequests: 1 (detection), 3 (classification), 3 (recognition)
[ INFO ] 6 streams for CPU
[ INFO ] Display resolution: 1920x1080
[ INFO ] Number of allocated frames: 3
[ INFO ] Resizable input with support of ROI crop and auto resize is disabled
26.7FPS for (1 / 1) frames
Detection InferRequests usage: 100.0%

[ INFO ] Execution successful


###################################################

Demo completed successfully.

4. 修改源码 保存结果

# cd 到源码  以security_barrier_camera_demo为例
root@e435a63279f8: cd /opt/intel/openvino_2021.2.185/deployment_tools/open_model_zoo/demos/security_barrier_camera_demo
root@e435a63279f8: vim main.cpp

修改364行:

      //cv::imshow("Detection results", firstGridIt->second.getMat());
      slog::info << "save image demo_output.jpg" << slog::endl;
      cv::imwrite("/opt/intel/openvino/deployment_tools/demo/output/demo_test.jpg", firstGridIt->second.getMat());

cd /opt/intel/openvino_2021.2.185/deployment_tools/demo
./demo_security_barrier_camera.sh

由于还没搞数据卷,从容器中将图片文件复制到主机

 [root@abc123 /]# docker cp e435a63279f8:/opt/intel/openvino/deployment_tools/demo/output/ /source/d0/openVino/docker_openvino/output_docker/

# 主机复制到容器
#[root@abc123 /]# docker cp /home/***/openvino_models/ e435a63279f8:/root

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-lk8ysvoG-1611888264819)(images/image-20210129103626119.png)]

``

root@e435a63279f8: cd /opt/intel/openvino_2021.2.185/deployment_tools/demo
./demo_security_barrier_camera.sh

由于还没搞数据卷,从容器中将图片文件复制到主机

Ctrl+P+Q
 docker cp e435a63279f8:/opt/intel/openvino/deployment_tools/demo/output/ /source/d0/openVino/docker_openvino/output_docker/

# 主机复制到容器
# docker cp /(path)/openvino_models/ e435a63279f8:/root

在这里插入图片描述

如何提交你自己的镜像

commit镜像

如果你想要保存当前容器的状态,就可以通过commit来提交,生成一个新的镜像。

docker commit 提交容器成为一个新的副本

# 命令和git原理类似
docker commit -m=“提交的描述信息” -a="作者" 容器id 目标镜像名:[TAG]

实践测试

# 1. 启动一个默认的镜像  以docker openvino为例
docker run -it -u 0 openvino/ubuntu18_dev

# 2. 发现默认的镜像 没有其它一些需要的指令或者packages
# 没有sudo vim等指令
root@d3e2a3d5a7cd:/opt/intel/openvino_2021.2.185# sudo
bash: sudo: command not found

# 3. 拷贝或者添加自己的文件进去
root@d3e2a3d5a7cd:/opt/intel/openvino_2021.2.185# apt-get install
root@d3e2a3d5a7cd:/opt/intel/openvino_2021.2.185# apt-get install sudo
root@d3e2a3d5a7cd:/opt/intel/openvino_2021.2.185# apt-get install vim
# 将主机的文件 复制 到容器
# Ctrl+P+Q 后台退出
[root@abc123 /]# docker cp /src/openvino_models/ d3e2a3d5a7cd:/root
# 再次进入容器
[root@abc123 /]# docker exec -it d3e2a3d5a7cd /bin/bash
[setupvars.sh] OpenVINO environment initialized
root@d3e2a3d5a7cd:/opt/intel/openvino_2021.2.185#
root@d3e2a3d5a7cd:/# cd /root   # openvino下载的路径(这里是预先cp)
root@d3e2a3d5a7cd:~# ls
# 拷贝的文件
openvino_models
# 再次测试
root@d3e2a3d5a7cd:/opt/intel/openvino/deployment_tools/demo# ./demo_security_barrier_camera.sh -d CPU -sample-options -no_show

[ INFO ] InferenceEngine:       API version ......... 2.1
        Build ........... 2021.2.0-1877-176bdf51370-releases/2021/2
[ INFO ] Files were added: 1
[ INFO ]     /opt/intel/openvino/deployment_tools/demo/car_1.bmp
[ INFO ] Loading device CPU
[ INFO ]        CPU
        MKLDNNPlugin version ......... 2.1
        Build ........... 2021.2.0-1877-176bdf51370-releases/2021/2

[ INFO ] Loading detection model to the CPU plugin
[ INFO ] Loading Vehicle Attribs model to the CPU plugin
[ INFO ] Loading Licence Plate Recognition (LPR) model to the CPU plugin
[ INFO ] Number of InferRequests: 1 (detection), 3 (classification), 3 (recognition)
[ INFO ] 6 streams for CPU
[ INFO ] Display resolution: 1920x1080
[ INFO ] Number of allocated frames: 3
[ INFO ] Resizable input with support of ROI crop and auto resize is disabled
20.4FPS for (1 / 1) frames
Detection InferRequests usage: 100.0%

[ INFO ] Execution successful

# 如果不打包成新镜像,每次都要重复上述步骤,这显然不是我们想要的

# 4. commit 制作新镜像
# Ctrl+P+Q 后台退出
[root@abc123 /]# docker commit -a="guojing" -m="add vim、sudo and model" 782cb305a98a openvino01:1.0

# 生成新的镜像 openvino01
[root@abc123 /]# docker images
REPOSITORY                       TAG       IMAGE ID       CREATED          SIZE
openvino01                       1.0       48d0ddc0ac05   26 seconds ago   9.7GB
openvino/ubuntu18_dev            latest    7362311fbea9   6 weeks ago      7.22GB
openvino/ubuntu18_runtime        latest    ba2618fce9ec   6 weeks ago      1.25GB
hello-world                      latest    bf756fb1ae65   13 months ago    13.3kB


# 进入新生成的镜像
[root@abc123 /]# docker run -it openvino01:1.0
[setupvars.sh] OpenVINO environment initialized
root@34336226f2ee:/opt/intel/openvino_2021.2.185#
# 可以运行sudo vim指令 不需要重新安装
root@34336226f2ee:/opt/intel/openvino_2021.2.185/deployment_tools/demo# vim
# 运行demo脚本,也顺利通过
root@34336226f2ee:/opt/intel/openvino_2021.2.185/deployment_tools/demo# ./demo_security_barrier_camera.sh -d CPU -sample-options -no_show

容器数据卷

什么是容器数据卷

docker理念:将应用和环境打包成镜像

对于数据

如果数据在容器中,那么容器删除,数据就会丢失!需求:数据可以持久化

docker容器之间可哟有个数据共享技术,其实就是挂载主机目录到容器上。

使用数据卷

方式一:直接使用命令来挂载 -v

[root@abc123 /]# docker run -it -v /src:/src openvino01:1.0
[setupvars.sh] OpenVINO environment initialized
root@2cd9a61e8464:/opt/intel/openvino_2021.2.185# cd /
root@2cd9a61e8464:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  source  srv  sys  thirdparty  tmp  usr  var

参考:https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html
https://hub.docker.com/r/openvino/ubuntu18_dev

猜你喜欢

转载自blog.csdn.net/weixin_40437821/article/details/113371991