55
66import logging as log
77import re
8- from abc import ABC
98from contextlib import contextmanager
109
1110from model_api .adapters .inference_adapter import InferenceAdapter
@@ -135,9 +134,11 @@ def create_model(
135134
136135 Args:
137136 model (str): model name from OpenVINO Model Zoo, path to model, OVMS URL
138- configuration (:obj:`dict`, optional): dictionary of model config with model properties, for example confidence_threshold, labels
137+ configuration (:obj:`dict`, optional): dictionary of model config with model properties, for example
138+ confidence_threshold, labels
139139 model_type (:obj:`str`, optional): name of model wrapper to create (e.g. "ssd")
140- preload (:obj:`bool`, optional): whether to call load_model(). Can be set to false to reshape model before loading
140+ preload (:obj:`bool`, optional): whether to call load_model(). Can be set to false to reshape model before
141+ loading.
141142 core (optional): openvino.Core instance, passed to OpenvinoAdapter
142143 weights_path (:obj:`str`, optional): path to .bin file with model weights
143144 adaptor_parameters (:obj:`dict`, optional): parameters of ModelAdaptor
@@ -147,7 +148,8 @@ def create_model(
147148 max_num_requests (:obj:`int`, optional): number of infer requests for asynchronous inference
148149 precision (:obj:`str`, optional): inference precision (e.g. "FP16")
149150 download_dir (:obj:`str`, optional): directory where to store downloaded models
150- cache_dir (:obj:`str`, optional): directory where to store compiled models to reduce the load time before the inference
151+ cache_dir (:obj:`str`, optional): directory where to store compiled models to reduce the load time before
152+ the inference.
151153
152154 Returns:
153155 Model object
@@ -482,11 +484,13 @@ def log_layers_info(self):
482484 """Prints the shape, precision and layout for all model inputs/outputs."""
483485 for name , metadata in self .inputs .items ():
484486 self .logger .info (
485- f"\t Input layer: { name } , shape: { metadata .shape } , precision: { metadata .precision } , layout: { metadata .layout } " ,
487+ f"\t Input layer: { name } , shape: { metadata .shape } , "
488+ f"precision: { metadata .precision } , layout: { metadata .layout } " ,
486489 )
487490 for name , metadata in self .outputs .items ():
488491 self .logger .info (
489- f"\t Output layer: { name } , shape: { metadata .shape } , precision: { metadata .precision } , layout: { metadata .layout } " ,
492+ f"\t Output layer: { name } , shape: { metadata .shape } , "
493+ f"precision: { metadata .precision } , layout: { metadata .layout } " ,
490494 )
491495
492496 def save (self , xml_path , bin_path = "" , version = "UNSPECIFIED" ):
0 commit comments