资源简介
此demo的python源代码
模型person-detection-retail-0013
示例视频文件
相关文章介绍 https://mp.csdn.net/postedit/93968520
代码片段和文件信息
#!/usr/bin/env python3
“““
Copyright (c) 2018 Intel Corporation.
Permission is hereby granted free of charge to any person obtaining
a copy of this software and associated documentation files (the
“Software“) to deal in the Software without restriction including
without limitation the rights to use copy modify merge publish
distribute sublicense and/or sell copies of the Software and to
permit persons to whom the Software is furnished to do so subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND
EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION
OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
“““
import os
import sys
import logging as log
from openvino.inference_engine import IENetwork IEPlugin
class Network:
“““
Load and configure inference plugins for the specified target devices
and performs synchronous and asynchronous modes for the specified infer requests.
“““
def __init__(self):
self.net = None
self.plugin = None
self.input_blob = None
self.out_blob = None
self.net_plugin = None
self.infer_request_handle = None
def load_model(self model device input_size output_size num_requests cpu_extension=None plugin=None):
“““
Loads a network and an image to the Inference Engine plugin.
:param model: .xml file of pre trained model
:param cpu_extension: extension for the CPU device
:param device: Target device
:param input_size: Number of input layers
:param output_size: Number of output layers
:param num_requests: Index of Infer request value. Limited to device capabilities.
:param plugin: Plugin for specified device
:return: Shape of input layer
“““
model_xml = model
model_bin = os.path.splitext(model_xml)[0] + “.bin“
# Plugin initialization for specified device
# and load extensions library if specified
if not plugin:
log.info(“Initializing plugin for {} device...“.format(device))
self.plugin = IEPlugin(device=device)
else:
self.plugin = plugin
if cpu_extension and ‘CPU‘ in device:
self.plugin.add_cpu_extension(cpu_extension)
# Read IR
log.info(“Reading IR...“)
self.net = IENetwork(model=model_xml weights=model_bin)
log.info(“Loading IR to the plugin...“)
if self.plugin.device == “CPU“:
supported_layers = self.plugin.get_s
相关资源
- Hands-On Transfer Learning with Python带书签
- tensorflow-2.0.0rc0-cp36-cp36m-linux_aarch64.w
- Python-效果超赞的图片自动增强GANs非成
- OpenCV3计算机视觉Python语言实现(第二
- Hands-On Reinforcement Learning with Python /S
- opencv_python-3.3.0+contrib-cp36-cp36m-win_amd
- 眨眼检测代码
- python爬取天气数据并制图分析
- 2017年传智黑马python基础加就业班视频
- python三剑客
- 吴恩达老师机器学习课的笔记,Pyth
- tensorflow_gpu-1.13.1-cp37
- Python和Gephi实现中国知网合作关系知识
- Python编程从入门到实践.pdf
- Python爬虫开发项目实战电子书 本书为
- OpenCV 3计算机视觉:Python语言实现
- Python语言程序设计扫描版_斯坦福大学
- Python语言在Abaqus中的应用DVD光盘
- 利用python绘制热图、计算网络节点d
-
64位系统的ba
semap和pyproj(适合pyth - Python课程期末作业.7z
- 菊安酱机器学习PDF.rar
- 凯斯西储大学(CWRU)轴承数据集含数
- Python-VoiceactivitydetectionVAD语音端点检测
- numpy-1.19.3+mkl-cp38-cp38-win_amd64.whl
- python语言在abaqus中的应用随书光盘.
- 量化投资:以Python为工具.蔡立耑(带
- Python机器学习基础教程中文版Introdu
- Python技术手册(第2版)[扫描版]
- Python语言在Abaqus中的应用 源代码
评论
共有 条评论