Converter to covert annotations into different formats.

AnnotationConverter
The Annotation Converter.

convert[source]

convert(input_adapter:AnnotationAdapter, output_adapter:AnnotationAdapter)

Convert input annotations to output annotations. input_adapter: the input annotation adapter output_adapter: the output annotation adapter

Helper Methods

configure_logging[source]

configure_logging(logging_level=20)

Configures logging for the system.

:param logging_level: The logging level to use.

Run from command line

To run the annotation converter from command line, use the following command: python -m mlcore.annotation_converter [parameters]

The following parameters are supported:

  • -i, --input_adapter: The annotation adapter to the annotations to convert from (e.g.: VIAAnnotationAdapter)
  • -o, --output_adapter: The annotation adapter to the annotations to convert to (e.g.: MultiCategoryAnnotationAdapter)

Example: Image Object Detection to Multi Category Image Classification

To convert image object detection annotations to multi category image classifications, run the following command:

python -m mlcore.annotation_converter --input_adapter VIAAnnotationAdapter --input_path data/image_object_detection/my_collection --output_adapter MultiCategoryAnnotationAdapter --output_path data/image_classification/my_collection