> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/hi/apis/annotation-json-reference.md).

# एनोटेशन JSON संदर्भ

Unitlab एनोटेशन JSON संदर्भ: हर आइटम का UUEF डॉक्यूमेंट, जियोस्पेशियल मॉडल के लिए GeoJSON, और इमेज मॉडल का प्रेडिक्शन फ़ॉर्मैट, फ़ील्ड सहित।

Unitlab एनोटेशन के लिए तीन JSON बनावटें इस्तेमाल करता है:

| बनावट                                                          | कहाँ मिलती है                                                                                                                          |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **UUEF** (हर आइटम का एक JSON डॉक्यूमेंट)                       | UUEF फ़ॉर्मैट में रिलीज़ एक्सपोर्ट, एनोटेशन इम्पोर्ट, Agent स्टेज के read और save                                                      |
| **GeoJSON (जियोस्पेशियल मॉडल)**, एक RFC 7946 FeatureCollection | जियोस्पेशियल मॉडल का Model स्टेज को दिया जवाब। Agent save इसे `format="geojson"` के रूप में लेते हैं।                                  |
| **प्रेडिक्शन फ़ॉर्मैट (इमेज मॉडल)**                            | **My AI Models** में जोड़ा गया इमेज मॉडल Unitlab को जो प्रेडिक्शन लौटाता है। Agent save यही JSON `format="model"` के रूप में लेते हैं। |

दूसरे फ़ॉर्मैट में एक्सपोर्ट के लिए देखें [एक्सपोर्ट फ़ॉर्मैट और सोर्स शामिल करना](https://docs.unitlab.ai/documentation/hi/releases/export-formats-and-source-inclusion)। मौजूदा लेबल किसी प्रोजेक्ट में लाने के लिए देखें [एनोटेशन इम्पोर्ट](https://docs.unitlab.ai/api-sdk-cli/hi/sdks/annotation-imports.md)। अपना मॉडल जोड़ने के लिए देखें [अपने मॉडल लाएँ](https://docs.unitlab.ai/documentation/hi/auto-labeling/bring-your-own-models)।

{% hint style="info" %}
**कोऑर्डिनेट** मूल मीडिया के पिक्सल में होते हैं: x दाईं ओर, y नीचे की ओर, और (0, 0) ऊपरी बाएँ कोने पर। यह इमेज, वीडियो फ़्रेम, मेडिकल स्लाइस, PDF पेज और पूरे रिज़ॉल्यूशन वाले बड़े raster व स्लाइड पर लागू होता है। जियोस्पेशियल मॉडल इसकी जगह मैप कोऑर्डिनेट में जवाब दे सकता है (देखें [GeoJSON (जियोस्पेशियल मॉडल)](#geojson-for-geospatial-models))।
{% endhint %}

## UUEF डॉक्यूमेंट <a href="#uuef-document" id="uuef-document"></a>

UUEF रिलीज़ का हर आइटम एक JSON डॉक्यूमेंट होता है। हर UUEF रिलीज़ आर्काइव के root में JSON Schema `uuef.schema.json` के रूप में शामिल होता है।

```json
{
  "version": "1.0",
  "media": {
    "filename": "street_001.jpg",
    "media_type": "Image",
    "origin": {"media_id": "…", "release_id": "…", "release_version": "v1"},
    "source_url": "https://…",
    "width": 1920,
    "height": 1080
  },
  "labels": [
    {
      "id": "b7c1…",
      "value": 1,
      "geometry": {"type": "bbox", "points": [[100, 50], [300, 50], [300, 200], [100, 200]]},
      "properties": [{"id": 3, "name": "Occluded", "type": "boolean", "value": false}],
      "attributes": {}
    }
  ],
  "classes": [
    {"name": "Car", "value": 1, "markup_type": "bbox", "color": "#e5484d", "attributes": [], "properties": []}
  ],
  "item_property_definitions": [],
  "item_properties": [],
  "data_tags": [],
  "relations": []
}
```

### शीर्ष-स्तरीय फ़ील्ड <a href="#top-level-fields" id="top-level-fields"></a>

| फ़ील्ड                                         | अर्थ                                                                                                                                                                                                                                                                                                  |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `version`                                      | हमेशा `"1.0"`।                                                                                                                                                                                                                                                                                        |
| `media`                                        | आइटम: `filename`, `media_type`, `origin` (जिस आइटम और रिलीज़ से यह आया), `source_url` (मूल फ़ाइल का लिंक) और, डेटा टाइप के अनुसार, `width`/`height`, `total_frames`/`fps`/`duration`, `page_count`, या जियोस्पेशियल raster के लिए `geospatial` (`crs`, `transform`, `bounds_native`, `bounds_wgs84`)। |
| `classes`                                      | प्रोजेक्ट की क्लास: `name`, `value` (वह क्लास नंबर जिसका लेबल हवाला देते हैं), `markup_type`, `color`, और क्लास की `attributes` व `properties` परिभाषाएँ।                                                                                                                                             |
| `labels`                                       | आइटम पर ऑब्जेक्ट (नीचे देखें)।                                                                                                                                                                                                                                                                        |
| `item_property_definitions`, `item_properties` | आइटम-स्तरीय properties: उनकी परिभाषाएँ और इस आइटम पर सेट मान।                                                                                                                                                                                                                                         |
| `data_tags`                                    | आइटम के टैग।                                                                                                                                                                                                                                                                                          |
| `relations`                                    | लेबल के बीच के संबंध (नीचे देखें)।                                                                                                                                                                                                                                                                    |
| `group`                                        | सिर्फ़ उस आइटम के लिए जो किसी Data Group का पैनल है: ग्रुप और पैनल।                                                                                                                                                                                                                                   |

### लेबल <a href="#labels" id="labels"></a>

हर लेबल में ये होते हैं:

| फ़ील्ड        | अर्थ                                                                                       |
| ------------- | ------------------------------------------------------------------------------------------ |
| `id`          | ऑब्जेक्ट का id। यह संस्करणों और रिलीज़ में एक जैसा रहता है।                                |
| `value`       | क्लास नंबर: `classes` की किसी एंट्री का `value`।                                           |
| `properties`  | `{id, name, type, value}` की सूची। selection में चुने गए विकल्प का `id` और `name` होता है। |
| `attributes`  | क्लास के attribute मान।                                                                    |
| `page_number` | सिर्फ़ PDF: पेज, 1 से शुरू।                                                                |

साथ में ठीक एक आकृति:

| आकृति        | JSON                                                                                                                |
| ------------ | ------------------------------------------------------------------------------------------------------------------- |
| Bounding box | `"geometry": {"type": "bbox", "points": [[x, y], [x, y], [x, y], [x, y]]}`: चार कोने, ऊपरी बाएँ से घड़ी की दिशा में |
| Polygon      | `"polygon": {"paths": [[[x, y], …], [[x, y], …]]}`: पहले बाहरी रेखा, फिर हर छेद का एक path                          |
| Mask         | `"mask": {"rle": […], "left": 10, "top": 20, "width": 64, "height": 48}` (नीचे देखें)                               |
| Point        | `"point": [x, y]`                                                                                                   |
| Line         | `"polyline": {"point": [[x, y], …]}`                                                                                |
| Skeleton     | `"skeleton": {"point": [[x, y], …]}`                                                                                |
| Cuboid       | `"cuboid": {"point": [[x, y], …]}`: आठ कोने, एडिटर के क्रम में                                                      |

**Mask encoding।** `left`, `top`, `width` और `height` वह बॉक्स बताते हैं जिसे mask भरता है। `rle` उस बॉक्स को ऊपरी बाएँ पिक्सल से पंक्ति-दर-पंक्ति, खाली और भरे पिक्सल की बारी-बारी गिनती के रूप में कवर करता है। पहली गिनती खाली पिक्सल की होती है, और पहला पिक्सल भरा हो तो वह `0` होती है। उदाहरण: `[3, 2, 5]` का अर्थ है 3 खाली पिक्सल, 2 भरे, फिर 5 खाली।

टेक्स्ट, ऑडियो और time series लेबल में आकृति की जगह `type` होता है:

| डेटा टाइप   | लेबल                                                                                                                                                            |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| टेक्स्ट     | `"type": "entity"` के साथ character offset में `span: {start, end, text}`; पूरे टेक्स्ट की क्लास के लिए `"type": "classification"`                              |
| ऑडियो       | `"type": "event"` के साथ सेकंड में `interval: {start, end}`; पूरी फ़ाइल की क्लास के लिए `"type": "classification"`                                              |
| Time series | `"type": "interval"` के साथ `interval: {start, end}`, या `"type": "instant"` के साथ `instant: {x}`, X कॉलम की इकाइयों में (तारीख़ें UTC epoch milliseconds में) |

### वीडियो और मेडिकल: tracks <a href="#video-and-medical-tracks" id="video-and-medical-tracks"></a>

वीडियो या मेडिकल volume पर हर लेबल एक track होता है: एक ऑब्जेक्ट जिसे फ़्रेम (मेडिकल में स्लाइस) दर फ़्रेम फ़ॉलो किया जाता है।

```json
{
  "id": "car-1",
  "value": 1,
  "ranges": [[0, 3]],
  "track": {
    "0": {"keyframe": true,  "geometry": {"type": "bbox", "points": [[10, 10], [50, 10], [50, 40], [10, 40]]}},
    "1": {"keyframe": false, "geometry": {"type": "bbox", "points": [[12, 10], [52, 10], [52, 40], [12, 40]]}},
    "2": {"keyframe": true,  "geometry": {"type": "bbox", "points": [[14, 10], [54, 10], [54, 40], [14, 40]]}}
  },
  "properties": [],
  "attributes": {}
}
```

| फ़ील्ड          | अर्थ                                                                                                                                                       |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ranges`        | ऑब्जेक्ट कहाँ मौजूद है, `[start, end]` फ़्रेम नंबर के रूप में: `start` शामिल है और `end` नहीं। फ़्रेम 0 से शुरू होते हैं।                                  |
| `track`         | हर फ़्रेम नंबर की एक एंट्री, ऊपर वाली आकृतियों के साथ।                                                                                                     |
| `keyframe`      | जिस फ़्रेम को किसी (व्यक्ति या मॉडल) ने रखा उसके लिए `true`। keyframes के बीच भरे गए फ़्रेम के लिए `false`। रिलीज़ `ranges` का हर फ़्रेम सूचीबद्ध करती है। |
| `hidden_ranges` | वैकल्पिक: वे फ़्रेम रेंज जहाँ ऑब्जेक्ट बंद है।                                                                                                             |
| `plane`         | सिर्फ़ मेडिकल: वह व्यू जिस पर track बनाया गया (`sagittal` या `coronal`)। न हो तो व्यू axial है। फ़्रेम नंबर उसी व्यू की स्लाइस हैं।                        |

### संबंध (relations) <a href="#relations" id="relations"></a>

```json
{"id": "r1", "type_id": 2, "type": "drives", "source_id": "person-1", "target_id": "car-1"}
```

`source_id` और `target_id` लेबल के `id` हैं। जिस relation का source या target `labels` में नहीं है, उसे छोड़ दिया जाता है।

## GeoJSON (जियोस्पेशियल मॉडल) <a href="#geojson-for-geospatial-models" id="geojson-for-geospatial-models"></a>

कस्टम जियोस्पेशियल मॉडल Model स्टेज को GeoJSON `FeatureCollection` (RFC 7946) से जवाब देता है। वह इसे `{"status": "complete", "result": {…}}` में लपेटकर भी भेज सकता है।

```json
{
  "type": "FeatureCollection",
  "classes": ["building", "road"],
  "features": [
    {
      "type": "Feature",
      "geometry": {"type": "Polygon", "coordinates": [[[69.2401, 41.2995], [69.2410, 41.2995], [69.2410, 41.3001], [69.2401, 41.3001], [69.2401, 41.2995]]]},
      "properties": {"class_name": "building", "markup_type": "polygon", "confidence": 0.93}
    }
  ]
}
```

| फ़ील्ड                   | अर्थ                                                                                                             |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| `classes`                | मॉडल की क्लास: नाम, या `{name, markup_type}` ऑब्जेक्ट। किसी क्लास का नंबर इस सूची में उसकी स्थिति है, 0 से शुरू। |
| `properties.class_name`  | नाम से क्लास। वैकल्पिक रूप से, `properties.class` उसका नंबर देता है।                                             |
| `properties.markup_type` | वैकल्पिक: `bbox`, `polygon`, `mask`, `line` या `point`। न दिया जाए तो geometry से तय होता है।                    |
| `properties.confidence`  | वैकल्पिक, 0 से 1।                                                                                                |

Geometry और वह किस आकृति में बदलती है:

| Geometry       | बनती है                                                                      |
| -------------- | ---------------------------------------------------------------------------- |
| `Point`        | point                                                                        |
| `LineString`   | line                                                                         |
| `Polygon`      | polygon (डिफ़ॉल्ट), bounding box या mask। पहली ring के बाद की rings छेद हैं। |
| `MultiPolygon` | हर हिस्से का एक polygon या mask                                              |

कोऑर्डिनेट longitude/latitude (WGS84), raster की अपनी मैप इकाइयों, या raster पिक्सल में हो सकते हैं। Unitlab पूरे जवाब से तय करता है कि कौन-सा है। raster से बाहर जाने वाली आकृतियाँ उसके किनारे पर काट दी जाती हैं।

Agent स्टेज save (`format="geojson"`, जियोस्पेशियल और पैथोलॉजी आइटम के लिए) `classes` सूची के बिना वही features लेता है: `properties.class_name` किसी प्रोजेक्ट क्लास का नाम है, या `properties.class` प्रोजेक्ट क्लास का value, और feature का `id` ऑब्जेक्ट का id बन जाता है। पैथोलॉजी स्लाइड पिक्सल इस्तेमाल करती हैं।

## प्रेडिक्शन फ़ॉर्मैट (इमेज मॉडल) <a href="#prediction-format-image-models" id="prediction-format-image-models"></a>

**My AI Models** में जोड़ा गया इमेज मॉडल Unitlab को जो प्रेडिक्शन लौटाता है। Agent save यही JSON `format="model"` के रूप में लेते हैं। अनुरोध और जवाब का आधिकारिक विवरण [अपने मॉडल लाएँ](https://docs.unitlab.ai/documentation/hi/auto-labeling/bring-your-own-models#representative-image-request) में है, और उसका [Validation](https://docs.unitlab.ai/documentation/hi/auto-labeling/bring-your-own-models#validation) चरण मॉडल के जवाब की जाँच करता है; नीचे की कुंजियाँ एक संक्षिप्त सार हैं।

Unitlab मॉडल को एक JSON POST भेजता है, जिसमें `src` (इमेज का अस्थायी लिंक) और मॉडल के सहेजे गए पैरामीटर होते हैं। मॉडल हर उस आकृति के लिए ऑब्जेक्ट की एक सूची लौटाता है जो वह बनाता है, साथ में `classes`:

```json
{
  "classes": ["car", "person"],
  "bboxes": [[{"point": [[100, 50], [300, 50], [300, 200], [100, 200]], "class": 0}]],
  "polygons": [{"point": [[10, 10], [80, 12], [60, 90]], "class": 1}]
}
```

| कुंजी       | हर ऑब्जेक्ट                                                                                                                                                                                                               |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `classes`   | मॉडल की क्लास के नाम। हर ऑब्जेक्ट का `class` इस सूची में स्थान है, 0 से शुरू।                                                                                                                                             |
| `bboxes`    | `{point, class}` की सूचियों की सूची। `point` चार `[x, y]` कोने हैं।                                                                                                                                                       |
| `polygons`  | कम से कम तीन `[x, y]` बिंदुओं वाला `{point, class}`।                                                                                                                                                                      |
| `brush`     | पिक्सल mask `{rle, left, top, right, bottom, value}` (`right` और `bottom` आखिरी भरे कॉलम और पंक्ति हैं; `rle` [Mask encoding](#labels) की तरह), या outline `{point, holes, value, vector_brush: true}`। `value` क्लास है। |
| `points`    | `{point: [x, y], class}`                                                                                                                                                                                                  |
| `lines`     | `{point: [[x, y], …], class}`                                                                                                                                                                                             |
| `skeletons` | `{point: [[x, y], …], class}`                                                                                                                                                                                             |

सभी कोऑर्डिनेट मूल इमेज के पिक्सल में हैं। Model स्टेज मॉडल की क्लास को प्रोजेक्ट क्लास से मैप करता है।

Agent स्टेज save में `classes` प्रोजेक्ट क्लास के नाम देता है, जिन्हें नाम और ऑब्जेक्ट की आकृति से मिलाया जाता है, और सहेजे गए ऑब्जेक्ट को नए id मिलते हैं।
