# Outputs

One can download the annotated image into various formats. Following are the examples of annotated image of an orange.

<figure><img src="/files/v8g7NWTbbVKixk60FJZr" alt=""><figcaption><p>Annotated Image</p></figcaption></figure>

<figure><img src="/files/iYuqgpFE7RgTJHsQLbXz" alt=""><figcaption><p>Masked of Annotated Image</p></figcaption></figure>

The configuration can be downloaded using built in configuration or using YOLO format.

```json
{
   "orange.png":{
      "configuration":[
         {
            "image-name":"orange.png",
            "regions":[
               {
                  "region-id":"47643630436867834",
                  "image-src":"http://127.0.0.1:5000/uploads/orange.png",
                  "class":"Orange",
                  "comment":"",
                  "tags":"",
                  "points":[
                     [
                        0.4685613390092879,
                        0.7693498452012384
                     ],
                     [
                        0.6781491873065015,
                        0.6640866873065016
                     ],
                     [
                        0.723921246130031,
                        0.5092879256965944
                     ],
                     [
                        0.7480118034055728,
                        0.34055727554179566
                     ],
                     [
                        0.5841960139318886,
                        0.14705882352941177
                     ],
                     [
                        0.41917569659442727,
                        0.13312693498452013
                     ],
                     [
                        0.30113196594427244,
                        0.22755417956656346
                     ],
                     [
                        0.21079237616099072,
                        0.4411764705882353
                     ],
                     [
                        0.26620065789473685,
                        0.6764705882352942
                     ],
                     [
                        0.4011077786377709,
                        0.7879256965944272
                     ]
                  ]
               },
               {
                  "region-id":"5981359766055432",
                  "image-src":"http://127.0.0.1:5000/uploads/orange.png",
                  "class":"Apple",
                  "comment":"",
                  "tags":"",
                  "x":[
                     0.1770655959752322
                  ],
                  "y":[
                     0.11764705882352941
                  ],
                  "w":[
                     0.5854005417956657
                  ],
                  "h":[
                     0.6981424148606811
                  ]
               }
            ],
            "color-map":{
               "Orange":[
                  244,
                  67,
                  54
               ],
               "Apple":[
                  33,
                  150,
                  243
               ]
            }
         }
      ]
   }
}

```

### **YOLO Format**

[YOLO format](https://docs.ultralytics.com/datasets/detect/#ultralytics-yolo-format) is also supported by A.Lab. Below is an example of annotated ripe and unripe tomatoes. In this example, `0` represents ripe tomatoes and `1` represents unripe ones.

<figure><img src="/files/ogtD9vh1uirB2nNIxk18" alt=""><figcaption><p>Tomatoes Image</p></figcaption></figure>

Annotating it in A.Lab.

<figure><img src="/files/DXvDw0UDhriRB42E6zrR" alt=""><figcaption><p>Annotating Tomatoes</p></figcaption></figure>

The label of the above image are as follows:

```
0 0.213673 0.474717 0.310212 0.498856
0 0.554777 0.540507 0.306350 0.433638
1 0.378432 0.681239 0.223970 0.268879
```

Applying the generated labels we get following results.

<figure><img src="/files/tBTKqhFtAwNmpdrlpLFW" alt=""><figcaption><p>Annotated Tomatoes using Label values</p></figcaption></figure>

### Normalization process of YOLO annotations

**Example Conversion**

To convert non-normalized bounding box coordinates (xmax, ymax, xmin, ymin) to YOLO format (xcenter, ycenter, width, height):

<figure><img src="/files/lOgQTRor4ibInjZkVfCu" alt=""><figcaption><p>YOLO Annotation Normalization (Credit: Leandro de Oliveira)</p></figcaption></figure>

```python
# Assuming row contains your bounding box coordinates
row = {'xmax': 400, 'xmin': 200, 'ymax': 300, 'ymin': 100}
class_id = 0  # Example class id (replace with actual class id)

# Image dimensions
WIDTH = 640  # annotated image width
HEIGHT = 640  # annotated image height

# Calculate width and height of the bounding box
width = row['xmax'] - row['xmin']
height = row['ymax'] - row['ymin']

# Calculate the center of the bounding box
x_center = row['xmin'] + (width / 2)
y_center = row['ymin'] + (height / 2)

# Normalize the coordinates
normalized_x_center = x_center / WIDTH
normalized_y_center = y_center / HEIGHT
normalized_width = width / WIDTH
normalized_height = height / HEIGHT

# Create the annotation string in YOLO format
content = f"{class_id} {normalized_x_center} {normalized_y_center} {normalized_width} {normalized_height}"
print(content)
```

The above conversion will give us YOLO format string.

```txt
0 0.46875 0.3125 0.3125 0.3125
```

### **COCO Format**

[COCO JSON format](https://roboflow.com/formats/coco-json) is also supported by A.Lab. Below is an example of annotated ripe and unripe tomatoes. In this example, `0` represents ripe tomatoes and `1` represents unripe ones.

```json
{
  "info": {
    "description": "COCO Format Annotations",
    "url": "http://127.0.0.1:5000/",
    "version": "1.0",
    "year": 2026,
    "contributor": "Annotate Lab",
    "date_created": "2026-03-25T23:43:54.234369"
  },
  "licenses": [
    {
      "id": 1,
      "name": "Unknown",
      "url": ""
    }
  ],
  "images": [
    {
      "id": 1,
      "file_name": "glass_543.jpg",
      "width": 474,
      "height": 840,
      "license": 1,
      "date_captured": "2026-03-25T23:43:54.240259",
      "original_name": "glass_543"
    }
  ],
  "annotations": [
    {
      "id": 1,
      "image_id": 1,
      "category_id": 0,
      "bbox": [27.71, 189.24, 147.04, 419.04],
      "area": 61612.0,
      "segmentation": [],
      "iscrowd": 0
    },
    {
      "id": 2,
      "image_id": 1,
      "category_id": 0,
      "bbox": [190.21, 272.89, 145.21, 364.25],
      "area": 52920.0,
      "segmentation": [],
      "iscrowd": 0
    },
    {
      "id": 3,
      "image_id": 1,
      "category_id": 1,
      "bbox": [126.22, 459.97, 106.16, 225.86],
      "area": 23960.0,
      "segmentation": [],
      "iscrowd": 0
    }
  ],
  "categories": [
    {
      "id": 0,
      "name": "ripe",
      "supercategory": "tomato"
    },
    {
      "id": 1,
      "name": "unripe",
      "supercategory": "tomato"
    }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://annotate-docs.dwaste.live/fundamentals/set-up-and-run/outputs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
