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

本文介绍了如何在Windows 10系统中运行OpenVINO Toolkit的Pedestrian Tracker C++ Demo。首先,需确保已安装OpenVINO并成功编译例程。接着,通过Anaconda或CMD激活环境,初始化OpenVINO并进入例程的exe文件夹。运行Demo需要指定输入图像或视频地址、Pedestrian Detection Retail模型文件及Pedestrian Reidentification Retail模型文件,这些文件可从Open Model Zoo下载。注意,VPU设备需使用FP16版本的模型文件。通过wget命令可以获取.xml文件。最后,在正确配置参数后,执行命令运行Demo,Demo会使用OpenCV显示结果并渲染边界框、轨迹和文本。
摘要由CSDN通过智能技术生成

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

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

Run Pedestrian Tracker C++ Demo
  1. 进入annaconda环境 或者CMD
activate env_name
  1. 初始化openvino环境
cd C:\Program Files (x86)\IntelSWTools\openvino\bin
setupvars.bat
  1. 进入编译生成的例程exe文件夹下
C:\Users\hp\Documents\Intel\OpenVINO\inference_engine_demos_build\intel64\Release
  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.

根据上述输入参数,有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. 运行
    根据最终参数的选择在exe所在路径下执行以下命令:
./pedestrian_tracker_demo -i <路径视频文件> \
                          -m_det <模型路径> /person-detection-retail-0013.xml \
                          -m_reid <模型路径> /person-reidentification-retail-0031.xml \
                          -d_det GPU

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

运行截图后期补充。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值