Metadata-Version: 2.3
Name: dagshub-annotation-converter
Version: 0.0.12
Summary: Annotation converter between different formats
Project-URL: Documentation, https://github.com/dagshub/dagshub-annotation-converter#readme
Project-URL: Issues, https://github.com/dagshub/dagshub-annotation-converter/issues
Project-URL: Source, https://github.com/dagshub/dagshub-annotation-converter
Author-email: Kirill Bolashev <kirill@dagshub.com>
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Requires-Dist: lxml
Requires-Dist: pandas
Requires-Dist: pillow
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pyyaml
Requires-Dist: typing-extensions
Description-Content-Type: text/markdown

# 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](https://dagshub.com/Dean/COCO_1K) and uploading it into a DagsHub Datasource:

```python
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)
```
