Parse and validate model conversion configuration.
Config is the root configuration object used by hosted conversion. It accepts
either a compact single-stage mapping or an explicit stages mapping. For
model formats with embedded metadata, missing tensor shapes and data types are
inferred from the source file.
Example
A compact YAML configuration can define preprocessing and target options.
name: detector
input_model: detector.onnx
inputs:
- name: images
shape: [1, 3, 640, 640]
layout: NCHW
encoding:
from: RGB
to: BGR
mean_values: imagenet
rvc2:
number_of_shaves: 8
superblob: trueTop-level tensor shortcuts such as shape, layout, mean_values, and scale_values are propagated to inputs that do not override them. Unknown fields are rejected to catch misspelled options early.
| Class | |
Shared OpenVINO Model Optimizer and blob compiler options. |
| Class | |
Root configuration for a single- or multi-stage model. |
| Class | |
Base for strict configuration models that reject unknown fields. |
| Class | |
Input channel conversion performed before inference. |
| Class | |
Hailo Dataflow Compiler and hardware options. |
| Class | |
Tensor metadata and preprocessing for one model input. |
| Class | |
Shape, layout, and data type of one model output. |
| Class | |
RVC2 compilation options. |
| Class | |
RVC3 compilation and POT target options. |
| Class | |
Qualcomm SNPE conversion, quantization, and graph options. |
| Class | |
Configuration for one model in a conversion pipeline. |
| Class | |
Options shared by every conversion target. |
| Constant | NAMED |
Undocumented |
| Function | _extract |
Extracts the corresponding second path from a single IR path. |
| Function | _get |
Try tensor lookup first, then node lookup, for ONNX metadata. |
| Function | _get |
Read shape and dtype information for an ONNX node output. |
| Function | _get |
Read shape and dtype information for an ONNX tensor. |
Undocumented
| Value |
|
Any, input_bin_path: Any | None = None) -> tuple[ Path, Path]:
¶
Extracts the corresponding second path from a single IR path.
We assume that the base filename matches between the .bin and .xml file unless an explicit input_bin_path is provided.
Path, name: str) -> tuple[ list[ int] | None, DataType | None]:
¶
Try tensor lookup first, then node lookup, for ONNX metadata.