CVAT annotation tools for Docling document processing and evaluation
Project description
docling-cvat-tools
CVAT annotation tools for Docling document processing and evaluation.
This package provides comprehensive tools for working with CVAT (Computer Vision Annotation Tool) annotations in the context of Docling document processing and evaluation workflows.
Features
- CVAT XML Parsing: Parse and validate CVAT XML annotation files
- Document Conversion: Convert CVAT annotations to
DoclingDocumentformat - Validation: Validate CVAT annotations for correctness and completeness
- Visualization: Generate HTML visualizations of annotated documents
- CLI Tools: Command-line utilities for common CVAT workflows
Installation
pip install docling-cvat-tools
Or install as an optional dependency of docling-eval:
pip install "docling-eval[campaign-tools]"
Requirements
- Python >=3.10,<4.0
- docling-core (document types)
- docling (for document processing)
Usage
CLI Tools
Validate CVAT annotations
docling-cvat-validator path/to/annotations.xml
Convert CVAT to DoclingDocument
docling-cvat-to-docling --input_path path/to/cvat_folder --output-dir output/
Python API
from docling_cvat_tools.cvat_tools.parser import parse_cvat_file
from docling_cvat_tools.cvat_tools.cvat_to_docling import convert_cvat_to_docling
from docling_cvat_tools.cvat_tools.validator import validate_cvat_sample
# Parse CVAT XML file
parsed = parse_cvat_file(Path("annotations.xml"))
# Validate annotations
validation_result = validate_cvat_sample(
xml_path=Path("annotations.xml"),
image_filename="page_000001.png"
)
# Convert CVAT folder to DoclingDocuments
results = convert_cvat_to_docling(
xml_path=Path("annotations.xml"),
input_path=Path("document.pdf"),
image_identifier="page_000001.png",
output_dir=Path("output")
)
Integration with docling-eval
This package is designed to work seamlessly with docling-eval. When installed as an optional dependency, it enables CVAT-specific features in the evaluation framework:
- CVAT dataset builders (
CvatDatasetBuilder,CvatPreannotationBuilder) - CVAT evaluation pipelines
Package Structure
docling_cvat_tools.cvat_tools: Core CVAT parsing, conversion, and validationdocling_cvat_tools.datamodels: CVAT-specific data modelsdocling_cvat_tools.visualisation: HTML visualization utilitiesdocling_cvat_tools.cli: Command-line interface toolsdocling_cvat_tools.utils: Utility functions
Development
# Install in development mode
uv sync
# Run tests
uv run pytest
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docling_cvat_tools-0.0.1.tar.gz.
File metadata
- Download URL: docling_cvat_tools-0.0.1.tar.gz
- Upload date:
- Size: 80.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d9fab119d8db24d46bd73a10fcd5eebfaa604f0d67e9c6d37762904695bc864
|
|
| MD5 |
7b70c2575da03a0bad9703c48be94f2f
|
|
| BLAKE2b-256 |
b0418a2e84ae30b83d134aad88cb59be63e1f587f524b406cb9efdd669e67e40
|
Provenance
The following attestation bundles were made for docling_cvat_tools-0.0.1.tar.gz:
Publisher:
pypi.yml on docling-project/docling-cvat-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docling_cvat_tools-0.0.1.tar.gz -
Subject digest:
9d9fab119d8db24d46bd73a10fcd5eebfaa604f0d67e9c6d37762904695bc864 - Sigstore transparency entry: 798326012
- Sigstore integration time:
-
Permalink:
docling-project/docling-cvat-tools@5e44906eb867a8902a29666f0cb55f32e1ddd90f -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/docling-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@5e44906eb867a8902a29666f0cb55f32e1ddd90f -
Trigger Event:
release
-
Statement type:
File details
Details for the file docling_cvat_tools-0.0.1-py3-none-any.whl.
File metadata
- Download URL: docling_cvat_tools-0.0.1-py3-none-any.whl
- Upload date:
- Size: 81.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc966f2854e26a2dd64ccd7977f8ded8f2651bf8436dcea222120942bc3108c6
|
|
| MD5 |
3e02a1a9b1a34dce60d7f6c7218942a1
|
|
| BLAKE2b-256 |
0a67600cd20ddcbb53fa2867a45d9854005817cdd925760261dc5ae4fa4a7cae
|
Provenance
The following attestation bundles were made for docling_cvat_tools-0.0.1-py3-none-any.whl:
Publisher:
pypi.yml on docling-project/docling-cvat-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docling_cvat_tools-0.0.1-py3-none-any.whl -
Subject digest:
bc966f2854e26a2dd64ccd7977f8ded8f2651bf8436dcea222120942bc3108c6 - Sigstore transparency entry: 798326013
- Sigstore integration time:
-
Permalink:
docling-project/docling-cvat-tools@5e44906eb867a8902a29666f0cb55f32e1ddd90f -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/docling-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@5e44906eb867a8902a29666f0cb55f32e1ddd90f -
Trigger Event:
release
-
Statement type: