Data Format: Object Detection
Introduction
For object detection, since the Label field contains extensive content, a separate JSON file is used for annotation. 001.jpg is an original image, and 001.json contains the annotations and corresponding labels for multiple target objects in that image.
Example
json_Label,image_Source
labels/001.json,images/001.jpgThe JSON annotation content for object detection consists of bounding boxes with their corresponding content and attributes. Bounding boxes are divided into two types: two-point boxes and four-point boxes:
- Two-point box: defined by the top-left corner (x_min and y_min) and bottom-right corner (x_max and y_max)
- Four-point box: defined by 4 point coordinates starting from any point (top-left point) in clockwise direction. Four-point boxes can be rectangular or general quadrilateral
Annotation coordinates use relative positions of points on the image. For example: if image size is (800, 600) and point coordinate is (10, 30), then the bounding box representation is (10/800, 30/600), which equals (0.125, 0.05).
Field Description
- image_width - Width of the image
- image_height - Height of the image
- image_path - Relative path of the image file
- num_box - Number of bounding boxes in the image
- bboxes - List of bounding boxes in the image
- attributions - Custom attribute values used by the dataset (not used for training, but preserved for annotation purposes)
- label - Class label of the box
- x_min / y_min - Top-left corner coordinates of two-point box
- x_max / y_max - Bottom-right corner coordinates of two-point box
- x_arr - Sequential x coordinates of four points in four-point box
- y_arr - Sequential y coordinates of four points in four-point box
 
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
}