91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 84.42MB
    文件類型: .gz
    金幣: 1
    下載: 0 次
    發布日期: 2023-06-03
  • 語言: Python
  • 標簽: openVINO??python??

資源簡介

此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

評論

共有 條評論