otx.core.data.manager.dataset_manager#

Datumaro Helper.

Classes

DatasetManager()

The aim of DatasetManager is support datumaro functions at easy use.

class otx.core.data.manager.dataset_manager.DatasetManager[source]#

Bases: object

The aim of DatasetManager is support datumaro functions at easy use.

All kind of functions implemented in Datumaro are supported by this Manager. Since DatasetManager just wraps Datumaro’s function, All methods are implemented as static method.

static auto_split(task: str, dataset: Dataset, split_ratio: List[Tuple[str, float]]) dict[source]#

Automatically split the dataset: train –> train/val.

static export_dataset(dataset: Dataset, output_dir: str, data_format: str, save_media=True)[source]#

Export the Datumaro Dataset.

static get_data_format(data_root: str) str[source]#

Find the format of dataset.

static get_image_path(data_item: DatasetItem) str | None[source]#

Returns the path of image.

static get_train_dataset(dataset: Dataset) DatasetSubset[source]#

Returns train dataset.

static get_val_dataset(dataset: Dataset) DatasetSubset | None[source]#

Returns validation dataset.

static import_dataset(data_root: str, data_format: str, subset: str | None = None) dict[source]#

Import dataset.

static is_cvat_format(path: str) bool[source]#

Detect whether data path is CVAT format or not.

Currently, we used multi-video CVAT format for Action tasks.

This function can detect the multi-video CVAT format.

Multi-video CVAT format root |–video_0

|–images

|–frame0001.png

|–annotations.xml

|–video_1 |–video_2

will be deprecated soon.

static is_mvtec_format(path: str) bool[source]#

Detect whether data path is MVTec format or not.

Check the first-level architecture folder, to know whether the dataset is MVTec or not.

MVTec default structure like as below: root |–ground_truth |–train |–test

will be deprecated soon.