otx.core.config#
Config data type objects.
Functions
|
Representer function that converts any data to a YAML node. |
|
Resolve YAML list into Python integer tuple. |
|
Resolve YAML string into PyTorch dtype. |
|
Custom representer for converting dtype object to YAML sequence node. |
|
Determine whether to ignore aliases in YAML representation. |
|
Representer function for converting OTXTaskType or OTXTrainType to a YAML string representation. |
Register custom resolvers. |
- otx.core.config.any_representer(dumper: Dumper | SafeRepresenter, data: Any) ScalarNode [source]#
Representer function that converts any data to a YAML node.
- Parameters:
dumper (yaml.Dumper | yaml.representer.SafeRepresenter) – The YAML dumper or safe representer.
data (Any) – The data to be represented.
- Returns:
The YAML node representing the data.
- Return type:
yaml.Node
- otx.core.config.as_int_tuple(*args) tuple[int, ...] [source]#
Resolve YAML list into Python integer tuple.
Example
YAML file example:
```yaml mem_cache_img_max_size: ${as_int_tuple:500,500} ```
- otx.core.config.as_torch_dtype(arg: str) dtype [source]#
Resolve YAML string into PyTorch dtype.
Example
YAML file example:
```yaml transforms: - class_path: torchvision.transforms.v2.ToDtype init_args: dtype: ${as_torch_dtype:torch.float32} scale: True ```
- otx.core.config.dtype_representer(dumper: yaml.Dumper | yaml.representer.SafeRepresenter, data: dtype) yaml.ScalarNode [source]#
Custom representer for converting dtype object to YAML sequence node.
- Parameters:
dumper (yaml.Dumper) – The YAML dumper object.
data (dtype) – The dtype object to be converted.
- Returns:
The converted YAML node.
- Return type:
yaml.Node
- otx.core.config.ignore_aliases(self: SafeRepresenter, data: Any) bool [source]#
Determine whether to ignore aliases in YAML representation.
- Parameters:
data – The data to check.
- Returns:
True if aliases should be ignored, None otherwise.
- Return type:
bool | None
- otx.core.config.otx_str_type_representer(dumper: Dumper | SafeRepresenter, data: OTXTaskType | OTXTrainType) ScalarNode [source]#
Representer function for converting OTXTaskType or OTXTrainType to a YAML string representation.
- Parameters:
dumper (yaml.Dumper | yaml.representer.SafeRepresenter) – The YAML dumper or safe representer object.
data (OTXTaskType | OTXTrainType) – The OTXTaskType or OTXTrainType object to be represented.
- Returns:
The YAML ScalarNode representation of the given object.
- Return type:
yaml.ScalarNode
Modules
Config data type objects for data. |
|
Config data type objects for device. |
|
Config data type objects for export method. |
|
Config objects for HPO. |