Utils#
- class model_api.adapters.utils.InputTransform(reverse_input_channels=False, mean_values=None, scale_values=None)#
Bases:
object
- __call__(inputs)#
Call self as a function.
- class model_api.adapters.utils.Layout(layout='')#
Bases:
object
- static from_openvino(input)#
Create Layout from openvino input
- static from_shape(shape)#
Create Layout from given shape
- Return type:
str
- static from_user_layouts(input_names, user_layouts)#
Create Layout for input based on user info
- static parse_layouts(layout_string)#
Parse layout parameter in format “input0:NCHW,input1:NC” or “NCHW” (applied to all inputs)
- Return type:
dict
|None
- model_api.adapters.utils.crop_resize(size, interpolation, pad_value)#
- Return type:
Callable
- model_api.adapters.utils.crop_resize_graph(input, size)#
- Return type:
Node
- model_api.adapters.utils.crop_resize_ocv(image, size)#
- Return type:
ndarray
- model_api.adapters.utils.get_rt_info_from_dict(rt_info_dict, path)#
- Return type:
OVAny
- model_api.adapters.utils.load_parameters_from_onnx(onnx_model)#
- Return type:
dict
[str
,Any
]
- model_api.adapters.utils.resize_image(size, interpolation, pad_value)#
- Return type:
Callable
- model_api.adapters.utils.resize_image_graph(input, size, keep_aspect_ratio, interpolation, pad_value)#
- Return type:
Node
- model_api.adapters.utils.resize_image_letterbox(size, interpolation, pad_value)#
- Return type:
Callable
- model_api.adapters.utils.resize_image_letterbox_graph(input, size, interpolation, pad_value)#
- Return type:
Node
- model_api.adapters.utils.resize_image_letterbox_ocv(image, size, interpolation=1, pad_value=0)#
- Return type:
ndarray
- model_api.adapters.utils.resize_image_ocv(image, size, keep_aspect_ratio=False, is_pad=False, pad_value=0, interpolation=1)#
- Return type:
ndarray
- model_api.adapters.utils.resize_image_with_aspect(size, interpolation, pad_value)#
- Return type:
Callable
- model_api.adapters.utils.resize_image_with_aspect_ocv(image, size, interpolation=1)#
- Return type:
ndarray