Skip to content

michelin/YarrowFormat

Repository files navigation

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

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().dict(), fp, default=str)

Format explanation

License

Apache 2.0