otx.data.utils#
Utility modules for core data modules.
Functions
|
Config tile parameters. |
|
Compute appropriate model input size w.r.t. |
- otx.data.utils.adapt_input_size_to_dataset(dataset: Dataset, task: OTXTaskType = OTXTaskType.DETECTION, input_size_multiplier: int | None = None) tuple[int, int] [source]#
Compute appropriate model input size w.r.t. dataset statistics.
- Parameters:
dataset (Dataset) – Datumaro dataset including all subsets.
task (OTXTaskType, optional) – Task type of the model. Defaults to OTXTaskType.DETECTION.
downscale_only (bool, optional) – Whether to allow only smaller size than default setting. Defaults to True.
input_size_multiplier (int | None, optional) – Multiplier for input size. If it’s set, return the input size which can be divisible by the value. Defaults to None.
- Returns:
Recommended input size based on dataset statistics.
- Return type:
- otx.data.utils.adapt_tile_config(tile_config: TileConfig, dataset: Dataset, task: OTXTaskType) None [source]#
Config tile parameters.
Adapt based on annotation statistics. i.e. tile size, tile overlap, ratio and max objects per sample
- Parameters:
tile_config (TileConfig) – tiling parameters of the model
dataset (Dataset) – Datumaro dataset including all subsets
task (Task) – task type of the model