semvec/pypi-packages huggingface dataset:
cvatkit 0.1.0
A toolkit for reading and processing CVAT annotation files
License: MIT
Requires Python: >=3.8
Keywords: annotations, computer-vision, cvat, image-annotations, xml

# CVAT Toolkit

A simple Python package for reading CVAT (Computer Vision Annotation Tool) annotation files.

## Features

- Read CVAT annotations from **XML** or **ZIP** files
- Parse **Polygons**, **Bounding Boxes**, and **Masks**
- Filter by **label** or **image name**
- Clean, typed API

## Requirements

- Python >= 3.8
- numpy >= 1.20.0

## Installation

```bash
pip install -e .
```

## Quick Start

```python
from cvatkit import CvatReader

# Load annotations (XML or ZIP)
reader = CvatReader("annotations.xml")

# Print summary
print(reader)

# Get polygons filtered by label
polygons = reader.get_polygons(label="collapse")

# Access polygon data
for polygon in polygons:
    print(f"Image: {polygon.image_name}")
    print(f"Points: {polygon.points}")  # numpy array (N, 2)
    print(f"Attributes: {polygon.attributes}")
```

## Examples

See [`demo.ipynb`](demo.ipynb) for complete examples including:

- Reading from XML and ZIP files
- Working with polygons, boxes, and masks
- Filtering by label and image name
- Using iterators for large datasets
- Getting statistics and summaries

## License

MIT License - see LICENSE file for details.