Import annotations

You can easily import annotation in COCO and PASCAL-VOC format from your Dataset page.

Supported formats

COCO format

If you want to know more about COCO Format, here is a simple example of this annotation format :

{
    "info": {
        "description": "COCO 2017 Dataset",
        "url": "http://cocodataset.org",
        "version": "1.0",
        "year": 2017,
        "contributor": "COCO Consortium",
        "date_created": "2017/09/01"
    },
    "licenses": [
        {
            "url": "http://creativecommons.org/licenses/by-nc-sa/2.0/",
            "id": 1,
            "name": "Attribution-NonCommercial-ShareAlike License"
        }
    ],
    "images": [
        {
            "license": 3,
            "file_name": "000000000192.jpg",
            "coco_url": "http://images.cocodataset.org/train2017/000000000192.jpg",
            "height": 480,
            "width": 640,
            "date_captured": "2013-11-22 22:14:30",
            "flickr_url": "http://farm7.staticflickr.com/6016/5960058194_1dfae5d508_z.jpg",
            "id": 74
        }
    ],
    "annotations": [
        {
            "segmentation": [
                [
                    321.0,
                    314.25,
                    307.99,
                    307.49,
                    293.94,
                    300.2,
                    286.14,
                    290.84,
                    277.81,
                ]
            ],
            "area": 18234.62355,
            "iscrowd": 0,
            "image_id": 74,
            "bbox": [
                25.3,
                61.87,
                276.25,
                296.42
            ],
            "category_id": 18,
            "id": 1774
        }
    ],
    "categories": [
        {
            "supercategory": "person",
            "id": 1,
            "name": "person"
        }
    ]
}

The basic top keys of a COCO dataset file .json are:

  • info: contains high-level information about the dataset.

  • licenses: contains a list of image licenses that apply to images in the dataset.

  • categories: contains a list of categories. Categories can belong to a supercategory

  • images: contains all the image information in the dataset without bounding box or segmentation information. image ids need to be unique

  • annotations: list of every individual object annotation from every image in the dataset

PASCAL-VOC format

Here is an example of a Pascal VOC .xml annotation format

<annotation>
    <folder>VOCimages</folder>
    <filename>FudanPed00013.png</filename>
    <path>/home/tibz/Documents/dev/VOCimages/FudanPed00013.png</path>
    <source>
        <database>Unknown</database>
    </source>
    <size>
        <width>652</width>
        <height>498</height>
        <depth>3</depth>
    </size>
    <segmented>0</segmented>
    <object>
        <name>person</name>
        <pose>Unspecified</pose>
        <truncated>0</truncated>
        <difficult>0</difficult>
        <bndbox>
            <xmin>385</xmin>
            <ymin>189</ymin>
            <xmax>557</xmax>
            <ymax>477</ymax>
        </bndbox>
    </object>
</annotation>

You can find more info in the following article made by Renu Khandelwal :)

Import options

When importing annotations from files, you have multiple options that will trigger different behaviours.

Keep the current annotation

If you chose this option, you would only attach annotation to images that don't have any annotation yet in this dataset.

Replace annotation

The import will erase all your annotations and replace them with the imported one.

Concatenate annotation

This option will concatenate the annotation. Be careful about this, you might end up with duplicate annotations!