Skip to main content

Annotation converter between different formats

Project description

DagsHub Annotation Converter

This package is intended to be a multi-type importer/exporter/converter between different annotation formats.

This package is currently in development and has not that many features implemented. The API is not stable and is subject to change.

Support Matrix for image annotations

Export > / Import V YOLO v5+ BBox YOLO v5+ Segmentation Yolo Poses COCO DagsHub Datasource (Label Studio) Label Studio CVAT Image
YOLO v5+ BBox -
YOLO v5+ Segmentation -
YOLO Poses -
COCO -
DagsHub Datasource (Label Studio) -
Label Studio -
CVAT Image -

Example usage, importing annotations from COCO_1K and uploading it into a DagsHub Datasource:

from dagshub_annotation_converter.image.importers import YoloImporter
from dagshub_annotation_converter.image.exporters import DagshubDatasourceExporter

from dagshub.data_engine.datasources import get_datasource

# Assuming that the current worker directory is the root of the repo and images are stored in "data" folder
importer = YoloImporter(
    data_dir="data",                 # Where the images are stored
    annotation_type="segmentation",  # or bbox for bounding boxes
    meta_file="custom_coco.yaml"     # file with the classes
)

proj = importer.parse()

exporter = DagshubDatasourceExporter(
    datasource=get_datasource("<user>/<repo>", "<my datasource>"),
    annotation_field="exported_yolo_annotations"
)
exporter.export(proj)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dagshub_annotation_converter-0.0.11.tar.gz (15.7 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page