当前位置:网站首页>基于OpenVINO工具套件简单实现YOLOv7预训练模型的部署
基于OpenVINO工具套件简单实现YOLOv7预训练模型的部署
2022-08-05 01:43:00 【英特尔边缘计算社区】
●一、YOLOv7简介●
官方版的YOLOv7相同体量下比YOLOv5精度更高,速度快120%(FPS),比 YOLOX 快180%(FPS),比 Dual-Swin-T 快1200%(FPS),比 ConvNext 快550%(FPS),比 SWIN-L快500%(FPS)。在5FPS到160FPS的范围内,无论是速度或是精度,YOLOv7都超过了目前已知的检测器,并且在GPU V100上进行测试, 精度为56.8% AP的模型可达到30 FPS(batch=1)以上的检测速率,与此同时,这是目前唯一一款在如此高精度下仍能超过30FPS的检测器。
论文链接:https://arxiv.org/abs/2207.02696
代码链接:https://github.com/WongKinYiu/yolov7

●二、预训练模型准备●
模型权重下载
可以从官方github仓库提供的链接中下载基于COCO数据集的YOLOv7预训练模型权重。
Model | Test Size | APtest | AP50test | AP75test | batch 1 fps | batch 32 average time |
YOLOv7 | 640 | 51.4% | 69.7% | 55.9% | 161 fps | 2.8 ms |
YOLOv7-x | 640 | 53.1% | 71.2% | 57.8% | 114 fps | 4.3ms |
YOLOv7-W6 | 1280 | 54.9% | 72.6% | 60.1% | 84 fps | 7.6 ms |
YOLOv7-E6 | 1280 | 56.0% | 73.5% | 61.2% | 56 fps | 12.3 ms |
YOLOv7-D6 | 1280 | 56.6% | 74.0% | 61.8% | 44 fps | 15.0 ms |
YOLOv7-E6E | 1280 | 56.8% | 74.4% | 62.1% | 36 fps | 18.7 ms |
模型转换
可以从官方github仓库提供的链接中下载基于COCO数据集的YOLOv7预训练模型权重。
# 下载YOLOv7官方仓库:
$ git clone [email protected]:WongKinYiu/yolov7.git
$ cd yolov7/models
$ python export.py --weights yolov7.pt
●三、模型部署●

通过Netron工具打开yolov7.onnx文件后可以看到,官方提供的预训练模型的output部分包含三个特征层的预测结果,因此需要根据每一层的先验框(anchor)对输出数据进行调整后,再进行堆叠。
由于YOLOv7的模型前后处理基本和YOLOv5一致,大部分数据处理模块可以直接复用。话不多说直接上代码:

●六、运行结果●
运行python示例后,会在本地data目录下生成代bounding box以及label的图片,这里我们用到官方仓库中附带的马匹数据进行测试,具体结果如下:
# 运行代码
$ python YOLOV7.py -i horse.jpg -m yolov7.onnx
Github地址:
https://github.com/OpenVINO-dev-contest/YOLOv7_OpenVINO
--END--
边栏推荐
- 测试工作这么难找吗?今年32,失业2个月,大龄测试工程师接下来该拿什么养家?
- ExcelPatternTool: Excel table-database mutual import tool
- 详细全面的postman接口测试实战教程
- 3. pcie.v 文件
- Is DDOS attack really unsolvable?Do not!
- Difference between MBps and Mbps
- 记录谷歌gn编译时碰到的一个错误“I could not find a “.gn“ file ...”
- ORA-00257
- dotnet 6 为什么网络请求不跟随系统网络代理变化而动态切换代理
- 【Word】Word公式导出PDF后出现井号括号#()错误
猜你喜欢
随机推荐
XMjs跨域问题解决
C# const readonly static 关键字区别
ExcelPatternTool: Excel表格-数据库互导工具
Gartner Hype Cycle:超融合技术将在2年内到达“生产力成熟期”
[Machine Learning] 21-day Challenge Study Notes (2)
3. pcie.v 文件
[How to smash wool according to the music the couple listens to during the Qixi Festival] Does the background music affect the couple's choice of wine?
【Word】Word公式导出PDF后出现井号括号#()错误
迁移学习——Distant Domain Transfer Learning
MySQL3
蓝牙Mesh系统开发四 ble mesh网关节点管理
Use of pytorch: Convolutional Neural Network Module
A new technical director, who calls DDD a senior, is convinced
[Endnote] Word inserts a custom form of Endnote document format
Difference between MBps and Mbps
Are testing jobs so hard to find?I am 32 this year and I have been unemployed for 2 months. What should an older test engineer do next to support his family?
Exercise: Selecting a Structure (1)
5.PCIe官方示例
为什么他们选择和AI恋爱?
5. PCIe official example









