Metadata-Version: 2.4
Name: vdschema
Version: 0.1.0
Summary: Unified annotation schema and JSONL IO for vision datasets.
Author-email: xiaokun1 <xiaokun1@sensetime.com>
Project-URL: Homepage, https://github.com/REPLACE_OWNER/vdschema
Project-URL: Repository, https://github.com/REPLACE_OWNER/vdschema
Project-URL: Issues, https://github.com/REPLACE_OWNER/vdschema/issues
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.26
Requires-Dist: pycocotools>=2.0.7

# vdschema

Unified annotation schema and JSONL IO for vision datasets.

`vdschema` can be used by annotation pipelines to write JSONL annotation files
and by training pipelines to read those files back into typed Python objects.

## Install

```bash
uv sync
```

## Basic Usage

```python
from vdschema import AnnotationReader, AnnotationWriter, DetectionAnnotation

writer = AnnotationWriter("output/detection/annotation_meta.jsonl", DetectionAnnotation)
writer.append(
    filename="images/sample.jpg",
    width=640,
    height=480,
    instances=[
        {"id": 0, "category_id": 1, "bbox": [10, 20, 100, 200]},
    ],
)
writer.save()

annotations = AnnotationReader(
    "output/detection/annotation_meta.jsonl",
    DetectionAnnotation,
).load()
```

## Development

```bash
uv sync --group dev
uv run python test_annotation_format.py
uv run ruff check .
uv build
```

## Publishing

This repository includes a GitHub Actions workflow for publishing to PyPI with
trusted publishing. Configure the PyPI project and GitHub environment before
creating a release.
