qbcompiler.configs.input_process_config¶
Uint8InputConfig¶
Configuration for uint8 input handling.
Defines whether inputs should be treated as uint8 and which specific inputs to apply this to.
Attributes¶
| Name | Description |
|---|---|
optional |
|
DEFAULTS |
|
py_to_cpp_name |
|
min_max_check |
optional¶
DEFAULTS¶
py_to_cpp_name¶
min_max_check¶
Methods¶
| Name | Description |
|---|---|
__init__ |
Initialize the Uint8InputConfig. |
default_config |
|
from_dict |
Create Uint8InputConfig from dictionary (JSON structure) |
to_dict |
__init__¶
Initialize the Uint8InputConfig.
Parameters
apply— bool. If true, treat specified inputs as uint8.inputs— List[str]. List of input names to treat as uint8. If empty and apply is true, applies to all inputs.optional— bool. Indicates whether this config is optional. Use the default value defined as a class variable.
default_config¶
from_dict¶
Create Uint8InputConfig from dictionary (JSON structure)
to_dict¶
PreprocessingConfig¶
Configuration for input preprocessing pipeline.
Defines preprocessing operations to be applied to model inputs, including operations like resize, normalize, color conversion, etc.
Attributes¶
| Name | Description |
|---|---|
optional |
|
DEFAULTS |
|
py_to_cpp_name |
|
min_max_check |
optional¶
DEFAULTS¶
py_to_cpp_name¶
min_max_check¶
Methods¶
| Name | Description |
|---|---|
__init__ |
Initialize the PreprocessingConfig. |
default_config |
|
from_dict |
Create PreprocessingConfig from dictionary (JSON structure) |
to_dict |
__init__¶
def __init__(
self,
apply: bool,
auto_convert_format: bool,
pipeline: List[Dict[str, Any]],
input_configs: Dict[str, Any],
optional: bool = optional,
)
Initialize the PreprocessingConfig.
Parameters
apply— bool. If true, apply preprocessing pipeline.auto_convert_format— bool. If true, automatically convert input format.pipeline— List[Dict[str, Any]]. List of preprocessing operations to apply globally. Each operation is a dict with "op" key and operation-specific parameters. Supported operations: colorConvert, resize, centerCrop, pad, letterbox, normalize, clamp, divideByScale, multiplyByScale, reshape, transpose, permute.input_configs— Dict[str, Any]. Per-input preprocessing configurations. Keys are input names, values are dicts containing input-specific pipelines.optional— bool. Indicates whether this config is optional. Use the default value defined as a class variable.
default_config¶
from_dict¶
Create PreprocessingConfig from dictionary (JSON structure)
to_dict¶
InputProcessConfig¶
Unified configuration for input processing.
Combines uint8 input handling, image channel configuration, and preprocessing pipeline settings into a single configuration object.
Attributes¶
| Name | Description |
|---|---|
optional |
|
DEFAULTS |
|
py_to_cpp_name |
|
min_max_check |
optional¶
DEFAULTS¶
DEFAULTS = {
"uint8_input": None, # Will use Uint8InputConfig.default_config()
"image_channels": 0,
"preprocessing": None, # Will use PreprocessingConfig.default_config()
}
py_to_cpp_name¶
min_max_check¶
Methods¶
| Name | Description |
|---|---|
__init__ |
Initialize the InputProcessConfig. |
default_config |
|
from_dict |
Create InputProcessConfig from dictionary (JSON structure) |
to_dict |
__init__¶
def __init__(
self,
uint8_input: Optional[Uint8InputConfig],
image_channels: int,
preprocessing: Optional[PreprocessingConfig],
optional: bool = optional,
)
Initialize the InputProcessConfig.
Parameters
uint8_input— Uint8InputConfig. Configuration for uint8 input handling. If None, uses default Uint8InputConfig.image_channels— int. Number of image channels (0=auto, 1=grayscale, 3=RGB, 4=RGBA).preprocessing— PreprocessingConfig. Configuration for input preprocessing pipeline. If None, uses default PreprocessingConfig.optional— bool. Indicates whether this config is optional.
default_config¶
from_dict¶
Create InputProcessConfig from dictionary (JSON structure)
to_dict¶
Functions¶
| Name | Description |
|---|---|
get_uint8_input_config |
Create Uint8InputConfig with partial parameters merged with defaults. |
get_preprocessing_config |
Create PreprocessingConfig with partial parameters merged with defaults. |
get_input_process_config |
Create InputProcessConfig with partial parameters merged with defaults. |
get_uint8_input_config¶
Create Uint8InputConfig with partial parameters merged with defaults.
get_preprocessing_config¶
Create PreprocessingConfig with partial parameters merged with defaults.
get_input_process_config¶
def get_input_process_config(
uint8_input_config: Optional[Uint8InputConfig] = None,
image_channels: int = 0,
preprocessing_config: Optional[PreprocessingConfig] = None,
) -> InputProcessConfig
Create InputProcessConfig with partial parameters merged with defaults.
Parameters
uint8_input_config— Uint8InputConfig. Configuration for uint8 input handling.image_channels— int. Number of image channels (0=auto, 1=grayscale, 3=RGB, 4=RGBA).preprocessing_config— PreprocessingConfig. Configuration for input preprocessing pipeline.
Returns
InputProcessConfig. The configured input process configuration.