Annotation formats

πŸ“˜

Don't worry

Right now, we only support our custom annotation format, which looks a lot like COCO json format.
Next SDK release will allow you to push annotation from .csv, .txt, coco and pascal voc.

To import an annotation to picsellia, you can use our python package.

pip install picsellia

Then use the picture.add_annotation() method with the good data format.

from picsellia import Client

client = Client(
   api_token="your api token",
)

dataset = client.get_dataset(name="my-awesome-dataset", version="latest")

pictures = dataset.list_pictures()

for picture in pictures:
    picture.add_annotation(
          data=data,
    )

Now let's see what's the data variable should look like πŸ˜ƒ

Object Detection Format

data = [
    {
        "type": "rectangle",
        "label": "car",
        "rectangle": {
            "top": 16,
            "left": 10,
            "width": 50,
            "height": 60
        }
    }
]
picture.add_annotation(data=data)

Image Segmentation Format

data = [{
    "type": "polygon", 
    "label" : "rose",
    "polygon": {
        "geometry": [
            {
                "x": 12,
                "y": 15
            },
            {
                "x": 178,
                "y": 151
            },
            {
                "x": 122,
                "y": 196
            },
            {
                "x": 112,
                "y": 10
            },
            
        ]
    }
}   
]
picture.add_annotation(data=data)

Classification format

data = [
    {
        "type": "classification",
        "label": "car"
    }
]
dataset.add_annotation(data=data)