当前位置:   article > 正文

win10环境搭建OpenVINO Toolkit并编译运行例程----(2)例程运行

openvino toolkit

运行例程是进行开发的第一步,本篇分享一下如何运行行人追踪的demo。
官网文档link
运行环境:
Windows10系统
在这里插入图片描述
关于工具包安装和例程编译参考上篇:

win10环境搭建OpenVINO Toolkit并编译运行例程----(1)openvino简介和win10环境搭建

Run Pedestrian Tracker C++ Demo
  1. 进入annaconda环境 或者CMD
activate env_name
  • 1
  1. 初始化openvino环境
cd C:\Program Files (x86)\IntelSWTools\openvino\bin
  • 1
setupvars.bat
  • 1
  1. 进入编译生成的例程exe文件夹下
C:\Users\hp\Documents\Intel\OpenVINO\inference_engine_demos_build\intel64\Release
  • 1
  1. 设置exe输入参数,文件下载。
./pedestrian_tracker_demo -h
InferenceEngine:
    API version ............ <version>
    Build .................. <number>
pedestrian_tracker_demo [OPTION]
Options:
    -h                           Print a usage message.
    -i "<path>"                  Required. Path to a video file or a folder with images (all images should have names 0000000001.jpg, 0000000002.jpg, etc).
    -m_det "<path>"              Required. Path to the Pedestrian Detection Retail model (.xml) file.
    -m_reid "<path>"             Required. Path to the Pedestrian Reidentification Retail model (.xml) file.
    -l "<absolute_path>"         Optional. For CPU custom layers, if any. Absolute path to a shared library with the kernels implementation.
          Or
    -c "<absolute_path>"         Optional. For GPU custom kernels, if any. Absolute path to the .xml file with the kernels description.
    -d_det "<device>"            Optional. Specify the target device for pedestrian detection (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin.
    -d_reid "<device>"           Optional. Specify the target device for pedestrian reidentification (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin.
    -r                           Optional. Output pedestrian tracking results in a raw format (compatible with MOTChallenge format).
    -pc                          Optional. Enable per-layer performance statistics.
    -no_show                     Optional. Do not show processed video.
    -delay                       Optional. Delay between frames used for visualization. If negative, the visualization is turned off (like with the option 'no_show'). If zero, the visualization is made frame-by-frame.
    -out "<path>"                Optional. The file name to write output log file with results of pedestrian tracking. The format of the log file is compatible with MOTChallenge format.
    -first                       Optional. The index of the first frame of video sequence to process. This has effect only if it is positive and the source video sequence is an image folder.
    -last                        Optional. The index of the last frame of video sequence to process. This has effect only if it is positive and the source video sequence is an image folder.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

根据上述输入参数,有3个必须输入的文件:

  • -i 输入图像或视频地址
  • -m_det Pedestrian Detection Retail model (.xml) 文件的地址
  • -m_reid Pedestrian Reidentification Retail model (.xml) file.文件的地址

后两个的下载可以从open model zoo中下载对应openVINO工具包版本文件夹下的xml和bin文件。下载link

其中VPU的设备必须使用FP16版本的文件。

另外,使用chrome浏览器直接点击下载只能下载bin文件,对于xml文件只能浏览的情况我使用了wget命令获取下载:
下载FP32/person-detection-retail-0013.xml 命令行示例:

wget --no-check-certificate https://download.01.org/opencv/2019/open_model_zoo/R3/20190905_163000_models_bin/person-detection-retail-0013/FP32/person-detection-retail-0013.bin
  • 1
  1. 运行
    根据最终参数的选择在exe所在路径下执行以下命令:
./pedestrian_tracker_demo -i <路径视频文件> \
                          -m_det <模型路径> /person-detection-retail-0013.xml \
                          -m_reid <模型路径> /person-reidentification-retail-0031.xml \
                          -d_det GPU
  • 1
  • 2
  • 3
  • 4

该演示使用OpenCV来显示结果帧,并将检测结果渲染为边界框,曲线(用于显示轨迹)和文本。

运行截图后期补充。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/161542?site
推荐阅读
相关标签
  

闽ICP备14008679号