class documentation

class ConvertCommand(Command): (source)

View In Hierarchy

Convert datasets on disk between supported formats.

Examples:

# Convert an image classification directory tree to TFRecords format
fiftyone convert \
    --input-dir /path/to/image-classification-directory-tree \
    --input-type fiftyone.types.ImageClassificationDirectoryTree \
    --output-dir /path/for/tf-image-classification-dataset \
    --output-type fiftyone.types.TFImageClassificationDataset

# Convert a COCO detection dataset to CVAT image format
fiftyone convert \
    --input-dir /path/to/coco-detection-dataset \
    --input-type fiftyone.types.COCODetectionDataset \
    --output-dir /path/for/cvat-image-dataset \
    --output-type fiftyone.types.CVATImageDataset

# Perform a customized conversion via optional kwargs
fiftyone convert \
    --input-dir /path/to/coco-detection-dataset \
    --input-type fiftyone.types.COCODetectionDataset \
    --input-kwargs max_samples=100 shuffle=True \
    --output-dir /path/for/cvat-image-dataset \
    --output-type fiftyone.types.TFObjectDetectionDataset \
    --output-kwargs force_rgb=True \
    --overwrite
Static Method execute Executes the command on the given args.
Static Method setup Setup the command-line arguments for the command.
@staticmethod
def execute(parser, args): (source)

Executes the command on the given args.

Parameters
parserthe argparse.ArgumentParser instance for the command
argsan argparse.Namespace instance containing the arguments for the command
@staticmethod
def setup(parser): (source)

Setup the command-line arguments for the command.

Parameters
parseran argparse.ArgumentParser instance