datasetinsights.datasets.transformers

datasetinsights.datasets.transformers.coco

class datasetinsights.datasets.transformers.coco.COCOInstancesTransformer(data_root)

Bases: datasetinsights.datasets.transformers.base.DatasetTransformer

Convert Synthetic dataset to COCO format.

This transformer convert Synthetic dataset into annotations in instance format (e.g. instances_train2017.json, instances_val2017.json)

Note: We assume “valid images” in the COCO dataset must contain at least one bounding box annotation. Therefore, all images that contain no bounding boxes will be dropped. Instance segmentation are considered optional in the converted dataset as some synthetic dataset might be generated without it.

Parameters

data_root (str) – root directory of the dataset

BBOX_NAME = '^(?:2[dD]\\s)?bounding\\sbox$'
INSTANCE_SEGMENTATION_NAME = '^instance\\ssegmentation$'
execute(output, **kwargs)

Execute COCO Transformer

Parameters

output (str) – the output directory where converted dataset will be stored.

class datasetinsights.datasets.transformers.coco.COCOKeypointsTransformer(data_root)

Bases: datasetinsights.datasets.transformers.base.DatasetTransformer

Convert Synthetic dataset to COCO format. This transformer convert Synthetic dataset into annotations in person keypoint format (e.g. person_keypoints_train2017.json, person_keypoints_val2017.json). Note: We assume “valid images” in the COCO dataset must contain at least one bounding box annotation. Therefore, all images that contain no bounding boxes will be dropped. Instance segmentation are considered optional in the converted dataset as some synthetic dataset might be generated without it. :param data_root: root directory of the dataset :type data_root: str

BBOX_NAME = '^(?:2[dD]\\s)?bounding\\sbox$'
INSTANCE_SEGMENTATION_NAME = '^instance\\ssegmentation$'
KPT_NAME = '^(?:2[dD]\\s)?keypoints$'
execute(output, **kwargs)

Execute COCO Transformer :param output: the output directory where converted dataset will

be stored.

datasetinsights.datasets.transformers.coco.uuid_to_int(input_uuid)
class datasetinsights.datasets.transformers.COCOInstancesTransformer(data_root)

Bases: datasetinsights.datasets.transformers.base.DatasetTransformer

Convert Synthetic dataset to COCO format.

This transformer convert Synthetic dataset into annotations in instance format (e.g. instances_train2017.json, instances_val2017.json)

Note: We assume “valid images” in the COCO dataset must contain at least one bounding box annotation. Therefore, all images that contain no bounding boxes will be dropped. Instance segmentation are considered optional in the converted dataset as some synthetic dataset might be generated without it.

Parameters

data_root (str) – root directory of the dataset

BBOX_NAME = '^(?:2[dD]\\s)?bounding\\sbox$'
INSTANCE_SEGMENTATION_NAME = '^instance\\ssegmentation$'
execute(output, **kwargs)

Execute COCO Transformer

Parameters

output (str) – the output directory where converted dataset will be stored.

class datasetinsights.datasets.transformers.COCOKeypointsTransformer(data_root)

Bases: datasetinsights.datasets.transformers.base.DatasetTransformer

Convert Synthetic dataset to COCO format. This transformer convert Synthetic dataset into annotations in person keypoint format (e.g. person_keypoints_train2017.json, person_keypoints_val2017.json). Note: We assume “valid images” in the COCO dataset must contain at least one bounding box annotation. Therefore, all images that contain no bounding boxes will be dropped. Instance segmentation are considered optional in the converted dataset as some synthetic dataset might be generated without it. :param data_root: root directory of the dataset :type data_root: str

BBOX_NAME = '^(?:2[dD]\\s)?bounding\\sbox$'
INSTANCE_SEGMENTATION_NAME = '^instance\\ssegmentation$'
KPT_NAME = '^(?:2[dD]\\s)?keypoints$'
execute(output, **kwargs)

Execute COCO Transformer :param output: the output directory where converted dataset will

be stored.

datasetinsights.datasets.transformers.get_dataset_transformer(format, **kwargs)

Returns instantiated transformer object based on the provided conversion format from a registry.

Parameters

format (str) – Conversion format to be used for dataset transformation.

Returns: Transformer object instance.