Annotation format of MSCOCO dataset (cocodataset.org), the data structure is as follows

{ "images": [ {"file_name":"cat.jpg", "id":1, "height":1000, "width":1000}, {"file_name":"dog.jpg", "id":2, "height":1000, "width":1000}, ... ] "Annotations" : [{" image_id ": 1," bbox ": [100.00, 200.00, 10.00, 10.00]," category_id ": {1} "image_id" : 2, "bbox" : [150.00, 250.00, 20.00, 20.00], "category_id" : 2}...].  "categories": [ {"id":0, "name":"bg"} {"id":1, "name":"cat"} {"id":1, "name":"dog"} ... ] }Copy the code

In the annotation file, “images” keyword corresponds to image information, “Annotations” keyword corresponds to the annotation information, and “Categories” corresponds to the category information: “images”: In the data corresponding to the keyword, each item corresponds to an image. “file_name” corresponds to the image name, “ID” corresponds to the image number, and “height” and “width” correspond to the height and width of the image respectively. “Annotations “: In the data corresponding to the keyword, each entry corresponds to a mark, “image_id” corresponds to the image serial number, and “bbox” corresponds to the marked rectangular frame, in the order of [X, Y, W, H], respectively, representing the starting point X coordinate, starting point Y coordinate, width and height of the rectangular frame. Category_id “corresponds to the category number. “Categories “: In the data corresponding to the keyword, each item corresponds to a category.” ID “corresponds to the category number, and “name” corresponds to the category name.

Annotations the element in “Annotations” is associated with the image using “image_id”, for example, “image_id”:2, which corresponds to the image whose “ID” is 2 in “images”. 2. The element in ‘category_id’ matches’ categories’ by looking at it from ‘category_id’, e.g. ‘category_id’ :2 ‘. This tagging information corresponds to the ‘category’ with ‘ID’ 2 in ‘Categories’.

Example: In the data structures listed above

{" image_id ": 1," bbox ": [100.00, 200.00, 10.00, 10.00]," category_id ": 1}Copy the code

From ‘image_id’ you can find that the corresponding image is’ cat.jpg ‘and’ category_id ‘you can find that the corresponding category is’ cat’.

The element in “Annotations”, “category_id”:0 corresponds to the background. If and only if ‘category_id’ is 0 in all annotations corresponding to an image, this image is the background image.