# Export data

In the projects home tab the "**Export labels**" button is located below the full description. A click on this button creates a new JSON file containing the labeled data. This button is only enabled if labeled data is available.

The exported JSON file starts with an overview of the label classes defined within the [label configuration](/documentation/label-configuration/what-is-a-label-configuration.md) followed by the list of tasks.&#x20;

### The used example:

For this documentation the following label configuration was used.

![](/files/-M1zP0lTmFi8Y8M4qVnN)

### Label classes:

The label classes may look like the following snippet:

{% code title="label\_classes.json" %}

```javascript
{ 
  "label_classes" : [ {
    "class_name": "bus",
    "geometry_type": "rectangle"
  }, {
    "class_name": "car",
    "geometry_type": "polygon"
  }, {
    "class_name": "car_type",
    "classification_type": "select"
  }, {
    "class_name": "weather",
    "classification_type": "radio"
  }, {
    "class_name" : "daytime",
    "classification_type" : "select"
  } ]
}
```

{% endcode %}

The `class_names` are **export keys** from the classifications and geometries defined in the label configuration. They are also used in the `labels` and `global_classifications` sections for each task. The `geometry_type` or `classification_type` describe the type of that classes.&#x20;

{% hint style="warning" %}
Classifications of **type option** are exported as *type radio* if they contain *up to three options* otherwise they are exported as *type select*.
{% endhint %}

### A single tasks:

Every exported task consists of the following properties:

{% code title="task\_snippted.json" %}

```javascript
{
  "internal_media_ID" : "datagym-image-id",
  "external_media_ID" : "awesome-image.jpg",
  "labeler" : "labeler-id",
  "status" : "completed",
  "segmentations": [],
  "global_classifications" : {},
  "labels" : {}
}
```

{% endcode %}

| Property                | Description                                                                                                                                                                                                                                                     |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| internal\_media\_ID     | The internal id to identify the media file. This ID can be used to [view or download the image](/documentation/dataset/manage-images.md#open-image).                                                                                                            |
| external\_media\_ID     | The media's file name.                                                                                                                                                                                                                                          |
| labeler                 | To identify the assigned labeler.                                                                                                                                                                                                                               |
| status                  | One of the task's states. See the documentation about [the task's lifecycle](/documentation/tasks/manage-tasks.md#tasks-lifecycle).                                                                                                                             |
| segmentations           | This section is optional and appears only if at least one image segmentation is configured. This list contains the urls to export the semantic maps. See [the API documentation](/documentation/api-token/api.md#export-segmentation-bitmaps) for more details. |
| global\_classifications | Uses the label\_classes to describe the image.                                                                                                                                                                                                                  |
| labels                  | Uses the class names listed in the label\_classes section to describe a geometry within the image.                                                                                                                                                              |

#### Global classifications:

The `global_classifications` section uses the `class_names` defined in the `label_classes` section to describe the image. This section may look like the following:

{% code title="global\_classifications.json" %}

```javascript
{
  "global_classifications" : {
    "weather" : [ "sunny", {
      "daytime" : [ "day" ]
    } ]
  }
}
```

{% endcode %}

Nested classifications are possible.

#### The Labels:

The label object contains an entry for each geometry type defined in the `label_classes` section with the `class_name` as key. Every entry contains a geometry of the assigned `geometry_type`. Each entry in that list consists of the `geometry` and `classifications` sections. The content of the geometry depends on the `geometry_type`  and the `classifications` are treated like the `global_classifications`. The labels section may look like the following snippet:

{% code title="labels\_snippet.json" %}

```javascript
{
  "labels" : {
    "bus": [],
    "car": []
  }
}
```

{% endcode %}

#### The geometries:

For every `geometry_type` defined in the `label_classes` sections, a list of objects is created. Every entry describes an area of interest in the image and is defined by its geometry and classifications.&#x20;

{% code title="geometry\_snippet.json" %}

```javascript
{
  "car": [ {
    "geometry": [{
      "x" : 57,
      "y" : 412
    }, {
      "x" : 54,
      "y" : 463
    }, {
      "x" : 130,
      "y" : 524
    }, {
      "x" : 1148,
      "y" : 684
    } ],
    "classifications": { 
      "car_type": [ null ]
    }
  } ]
}
```

{% endcode %}

#### Image segmentation geometries:

Image segmentation geometries are basically treated the same way as polygon geometries, except for the fact that they have multiple arrays of points.&#x20;

{% code title="seqmentation\_snipped.json" %}

```javascript
{
    "seqmentation" : [ {
      "geometry" : [ [ {
        "x" : 254,
        "y" : 173
      }, {
        "x" : 177,
        "y" : 174
      }, {
        "x" : 182,
        "y" : 77
      }, {
        "x" : 833,
        "y" : 50
      }, {
        "x" : 842,
        "y" : 160
      }, {
        "x" : 780,
        "y" : 161
      }, {
        "x" : 784,
        "y" : 322
      }, {
        "x" : 250,
        "y" : 313
      }, {
        "x" : 254,
        "y" : 173
      } ], [ {
        "x" : 579,
        "y" : 165
      }, {
        "x" : 685,
        "y" : 163
      }, {
        "x" : 688,
        "y" : 278
      }, {
        "x" : 579,
        "y" : 279
      }, {
        "x" : 579,
        "y" : 165
      } ], [ {
        "x" : 400,
        "y" : 169
      }, {
        "x" : 496,
        "y" : 167
      }, {
        "x" : 500,
        "y" : 275
      }, {
        "x" : 399,
        "y" : 272
      }, {
        "x" : 400,
        "y" : 169
      } ], [ {
        "x" : 285,
        "y" : 172
      }, {
        "x" : 332,
        "y" : 171
      }, {
        "x" : 331,
        "y" : 250
      }, {
        "x" : 286,
        "y" : 249
      }, {
        "x" : 285,
        "y" : 172
      } ] ],
      "classifications" : { }
    } ]
```

{% endcode %}

The first array of points are the outer points of the segmentation, while every following array is an inner segment that was cut out. The above JSON Snippet corresponds to the Segmentation in the image below.

![Segmentation with three inner cutouts](/files/-MEX09iWCWE8zAXidEeF)


---

# 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://docs.datagym.ai/documentation/project/export-data.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.
