当前位置:网站首页>三、OpenVINO实战:图像分类
三、OpenVINO实战:图像分类
2022-07-28 05:22:00 【Aaaaaki】
三、OpenVINO实战:图像分类
任务流程
终端初始化OpenVINO环境
进入OpenVINO安装目录,找到 setupvars.bat 文件并运行,结果如下图所示,即初始化成功。

模型获取与转换
调用模型下载器并通过 –print_all 查看可供下载的模型

通过 –name 选择squeezenet1.1 模型进行下载,结果如下图所示
- 在下载时若出现 [Error 11004] getaddrinfo failed 提示,原因在于host地址被墙,将地址 raw.githubusercontent.com 添加到host文件中即可。
- 可在 –name 后添加 –output_dir 指定下载路径

通过模型优化器(model_optimizer)将模型转换为IR文件
进入OpenVINO下的模型优化器文件夹 ./deployment_tools/model_optimizer ,因为下载的squeezenet1.1模型为caffe模型,因此运行 mo_caffe.py 文件进行转换。
python mo_caffe.py --input_model path --output_dir path运行成功后获得相应的 bin文件 和 xml文件

图像分类
准备好squeezenet1.1的标签文件 squeezenet1.1.labels,文件已传百度云
链接:https://pan.baidu.com/s/17BCKqbTGusnzE5THNz_Spg
提取码:ysew
从推理引擎示例中获取一个简单的分类示例
复制 ./OpenVINO/inference_engine/sample/python/classification_sample_async/ 路径下的 classification_sample_async.py 文件到你的 exercise 目录
运行该示例,指定输入图像、模型、标签文件以及设备,获取结果
python classification_samples_async.py -i image_path -m xml_path --labels label_path -d devices_name输入图像为:

最终分类结果为:

边栏推荐
- Deep learning - patches are all you need
- 【6】 Redis cache policy
- 小程序开发要多少钱?两种开发方法分析!
- 强化学习——不完全观测问题、MCTS
- 深度学习(增量学习)——ICCV2021:SS-IL: Separated Softmax for Incremental Learning
- Quick look-up table to MD5
- Alpine, Debian replacement source
- 微信团购小程序怎么做?一般要多少钱?
- 搭建集群之后崩溃的解决办法
- The project does not report an error, operates normally, and cannot request services
猜你喜欢

如何选择小程序开发企业

利用辅助未标记数据增强无约束人脸识别《Boosting Unconstrained Face Recognition with Auxiliary Unlabeled Data》

Reinforcement learning - continuous control

1: Why should databases be divided into databases and tables

UNL-类图

Reinforcement learning - Multi-Agent Reinforcement Learning

强化学习——Proximal Policy Optimization Algorithms

Reinforcement learning -- SARS in value learning

Distributed lock redis implementation

There is a problem with MySQL paging
随机推荐
小程序开发解决零售业的焦虑
Four perspectives to teach you to choose applet development tools?
Nlp项目实战自定义模板框架
1: Why should databases be divided into databases and tables
深度学习(自监督:SimSiam)——Exploring Simple Siamese Representation Learning
循环神经网络
将项目部署到GPU上,并且运行
TensorFlow2.1基本概念与常见函数
What is the detail of the applet development process?
一、语音合成与自回归模型
The signature of the update package is inconsistent with that of the installed app
transformer的理解
深度学习——Pay Attention to MLPs
Svn incoming content cannot be updated, and submission error: svn: e155015: aborting commit: XXX remains in conflict
Improved knowledge distillation for training fast lr_fr for fast low resolution face recognition model training
神经网络实现鸢尾花分类
There is a problem with MySQL paging
小程序开发如何提高效率?
How to improve the efficiency of small program development?
小程序搭建制作流程是怎样的?