Training Plate Config¶
This is the training-time PlateConfig schema validated with Pydantic. It defines plate alphabet, image
dimensions, preprocessing options, and region metadata used during training and export.
License Plate OCR config. This config file defines how license plate images and text should be preprocessed for OCR model training and inference.
PlateConfig ¶
Bases: BaseModel
Model License Plate config.
max_plate_slots
instance-attribute
¶
Max number of plate slots supported. This represents the number of model classification heads.
pad_char
instance-attribute
¶
Padding character for plates which length is smaller than MAX_PLATE_SLOTS.
keep_aspect_ratio
class-attribute
instance-attribute
¶
keep_aspect_ratio: bool = False
Keep aspect ratio of the input image.
interpolation
class-attribute
instance-attribute
¶
interpolation: ImageInterpolation = 'linear'
Interpolation method used for resizing the input image.
image_color_mode
class-attribute
instance-attribute
¶
image_color_mode: ImageColorMode = 'grayscale'
Input image color mode. Use 'grayscale' for single-channel input or 'rgb' for 3-channel input.
load_plate_config_from_yaml ¶
load_plate_config_from_yaml(
yaml_path: PathLike,
) -> PlateConfig
Reads and parses a YAML file containing the plate configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
yaml_path
|
PathLike
|
Path to the YAML file containing the plate config. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PlateConfig |
PlateConfig
|
Parsed and validated plate configuration. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the YAML file does not exist. |