Skip to main content

Data format: object detection

Introduce​

Object detection due to Label Multiple field contents. So use a separate one JSON File as annotation, 001.jpg It's an original picture, 001.json Then it refers to the annotations and corresponding labels of several target objects in the figure.

Example​

meta.csv
json_Label,image_Source
labels/001.json,images/001.jpg

Object detection JSON Annotated content. It is the annotation box and its corresponding content and attributes. The annotation box includes two point boxes and four point boxes:

  • The two-point box is located in the upper left corner (x_min and y_min)And the bottom right corner (x_max and y_max)Two points
  • The four point box is from any point (Top left point)Starting in a clockwise direction4Point coordinates. A four point box can be a rectangular box or a regular quadrilateral

The annotation coordinates use the relative positions of points on the image, for example: Image size (800, 600), Point coordinates (10, 30), The representation of the annotation box is (10/800, 30/600), That is (0.125, 0.05).

Field Description​

  • image_width - The width of this image
  • image_height - The height of the image
  • image_path - The relative path of the image file
  • num_box - The number of annotation boxes on this image
  • bboxes - List of annotation boxes on this image
    • attributions - Custom attribute values used in the dataset (Training not used. But there are reserved annotations)
    • label - The type annotation of this box
    • x_min / y_min - Coordinates of the upper left corner of the two-point box
    • x_max / y_max - Coordinate at the bottom right corner of the two-point box
    • x_arr - Four point box, four point sequence x coordinate
    • y_arr - Four point box, four point sequence y coordinate

Two point box annotation example​

{
"num_box": 2,
"bboxes": [
{
"attributions": {
"group": 0
},
"id": 0,
"label": "ball",
"x_max": 0.853887,
"x_min": 0.700299,
"y_max": 0.099826,
"y_min": 0.050272
},
{
"attributions": {
"group": 0
},
"id": 1,
"label": "ball",
"x_max": 0.719806,
"x_min": 0.692791,
"y_max": 0.163233,
"y_min": 0.110261
}
],
"image_path": "8/ballet_106_0.jpg",
"image_width": 600,
"image_height": 419
}

Four point box annotation example​

{
"num_box": 2,
"bboxes": [
{
"id": 0,
"attributions": {
"group": 0
},
"label": "ball",
"x_arr": [0.700982, 0.853886, 0.853203, 0.700299],
"y_arr": [0.050271, 0.055058, 0.099825, 0.095039]
},
{
"id": 1,
"attributions": {
"group": 0
},
"label": "ball",
"x_arr": [0.698083, 0.719805, 0.714512, 0.69279],
"y_arr": [0.11026, 0.115165, 0.163232, 0.158328]
}
],
"image_path": "8/ballet_106_0.jpg",
"image_width": 600,
"image_height": 419
}