模型贡献至Open model zoo(4)

4.Object Detection Python* Demo and contribute to OMZ

(1)from IE Demo

基础

作用
展示了如何使用IE推断model的主要思想。如果model解决了OMZ支持的任务之一,从demos或samples中找到合适的选项
自定义
demo可以用C++或者Python写,所需参数可自定义,并添加到demo的README.md中。
位置
/opt/intel/openvino_2021.2.185/deployment_tools/open_model_zoo/demos/python_demos/object_detection_demo
工具
Sync and Async API
The technique can be generalized to any available parallel slack, for example, doing inference and simultaneously encoding the resulting
(previous) frames or running further inference, like some emotion detection on top of the face detection results.
默认图像输入为BGR,如果模型训练时是RGB则需要在API中修改或者模型转换时使用–reverse_input_channels
使用
Build the demo applications on linux
环境
Ubuntu* 16.04 LTS 64-bit or CentOS* 7.4 64-bit
GCC* 5.4.0 (for Ubuntu* 16.04) or GCC* 4.8.5 (for CentOS* 7.4)
CMake* version 2.8 or higher

步骤
(1)将openvino添加进环境变量
在安装openvino时已设置
sudo find / -name setupvars.sh
/opt/intel/openvino_2021.2.185/bin/setupvars.sh
该语句在~/.bashrc已设置
(2)运行build脚本
cd /opt/intel/openvino_2021.2.185/deployment_tools/open_model_zoo/demos/
./build_demos.sh
在这里插入图片描述
显示:Build completed, you can find binaries for all demos in the ~/omz_demos_build/intel64/Release subfolder.
(4)运行demo
cd /opt/intel/openvino_2021.2.185/deployment_tools/inference_engine/demos/python_demos/object_detection_demo
python3 object_detection_demo.py -m
/opt/intel/openvino_2021.2.185/deployment_tools/open_model_zoo/tools/downloader/public/mobilenet-yolosyg/FP16/mobilenet-yolo-syg.xml -at yolo -i ~/Desktop/v6cut16s.mp4 -d CPU --labels
/opt/intel/openvino_2021.2.185/deployment_tools/open_model_zoo/tools/downloader/public/mobilenet-yolosyg/VOCdevkit/voc_label.json
FPS: average rate of video frame processing (frames per second)
Latency: average time required to process one frame (from reading the frame to displaying the results) You can use both of these metrics to measure application-level performance.

(5)结果展示
在这里插入图片描述

(2)contribute to OMZ

How to contribute models to open model zoo

pull说明

文档要求

Pull Request Requirements
configuration filemodel.yml
documentation of model in markdown formatmobilenet-yolo-syg.md
accuracy validation configuration fileaccuracy-check.yml
(optional) demo

Model Name

名称体现参考模型但不完全相同;
小写,推荐中横线 - ;
如果模型是来自另一个框架的现有模型的重新实现,则根据框架标识符添加后缀,否则不用

Files Location

在这里插入图片描述

Tests

downloader.py
converter.py
accuracy-checker
convert_annotation
annotation_checker

新建repo

Github pull request教程
之后PR有问题,官方人员会通过PR联系

猜你喜欢

转载自blog.csdn.net/m0_57273938/article/details/125372771