yarrowformat

Yarrow Format parsing lib


License
Apache-2.0
Install
pip install yarrowformat==2.1.0

Documentation

Yarrow: a data format for computer vision


PyPI version Documentation Status Test and Deploy Code style: black Imports: isort

What is it ?

yarrow is a python package to parse, manipulate and serialize data following the yarrow data schema. This format is oriented around computer vision data and is heavily inspired by the COCO dataset format and was initially developed and used in Michelin projects.

The full description can be found here with the rules on how to fill different fields.

How to install

pip install yarrowformat

Install it locally

make setup
source .venv/bin/activate

How to use

You can find multiple examples in the examples directory and the package API in the documentation (still WIP). Here are a few examples.

import json

from yarrow import YarrowDataset

# say you have a yarrow file at path
file_path = "path/to/file.yarrow.json"

yar_set = YarrowDataset.parse_file(file_path)
# You now have a YarrowDataset !

# Add annotations
annot = Annotation(...) # see documentation for parameters
yar_set.add_annotation(annot)

# now save it somewhere else
with open("path/to/other/file.yarrow.json", "w") as fp:
    json.dump(yar_set.pydantic().model_dump(exclude_none=True), fp, default=str)

Format explanation

License

Apache 2.0