# Image Metadata

Metadata आपको Roboflow workspace में images के साथ custom key-value pairs जोड़ने की सुविधा देता है। Metadata का उपयोग images के साथ संरचित जानकारी संग्रहीत करने के लिए करें — जैसे capture conditions, device identifiers, quality scores, या कोई भी domain-specific attributes — और फिर उन attributes के आधार पर अपने data को search, filter, और organize करें।

## Overview

हर image में metadata entries की कोई भी संख्या हो सकती है। एक entry एक **key** (जैसे कोई नाम, उदाहरण के लिए `camera_id`) के साथ एक **value** (string, number, या boolean) जुड़ा होता है।

| Value type | Examples                                    |
| ---------- | ------------------------------------------- |
| String     | `location: "warehouse-3"`, `shift: "night"` |
| Number     | `temperature: 72.5`, `quality_score: 95`    |
| Boolean    | `reviewed: true`, `is_night: false`         |

### Use cases

* **Capture context** — camera ID, GPS coordinates, weather, lighting conditions रिकॉर्ड करें
* **Quality tracking** — confidence scores, review status, annotator IDs जोड़ें
* **Data slicing** — targeted training sets बनाने के लिए अपने dataset को किसी भी attribute के आधार पर filter करें
* **External system linking** — ऐसे identifiers संग्रहीत करें जो images को आपके internal tools से जोड़ते हैं

## Adding Metadata

आप web UI, Python SDK, REST API, या S3 Bucket Mirror के माध्यम से automatically images में metadata जोड़ सकते हैं।

### Web Application

{% stepper %}
{% step %}

#### एक image खोलें

अपने project में कोई भी image खोलें।
{% endstep %}

{% step %}

#### key और value दर्ज करें

metadata section में, एक **key** पहले input में और एक **value** दूसरे input में दर्ज करें।
{% endstep %}

{% step %}

#### Add

दबाएँ **Enter** को save करने के लिए या Add पर click करें
{% endstep %}
{% endstepper %}

Values type के अनुसार automatically parse होती हैं:

| दर्ज की गई value | इस रूप में stored          |
| ---------------- | -------------------------- |
| `front`          | `"front"` (string)         |
| `95`             | `95` (number)              |
| `3.14`           | `3.14` (number)            |
| `true` / `false` | `true` / `false` (boolean) |

<figure><img src="/files/20c2e467343d15272c18e021bf283815f4f4520b" alt=""><figcaption><p>Annotation Tool का metadata editor</p></figcaption></figure>

### Python SDK

एक `metadata` dictionary image upload करते समय पास करें:

```python
import roboflow

rf = roboflow.Roboflow(api_key="YOUR_API_KEY")
project = rf.workspace("your-workspace").project("your-project")

project.upload(
    image_path="image.jpg",
    metadata={
        "camera_id": "cam001",
        "location": "warehouse-3",
        "temperature": 72.5,
        "is_night": False
    }
)
```

### REST API

#### Upload के दौरान metadata जोड़ें

एक `metadata` field (JSON-stringified) को image upload करते समय multipart form data में शामिल करें:

```bash
curl -X POST "https://api.roboflow.com/dataset/your-dataset/upload?api_key=YOUR_API_KEY" \
  -F "name=image.jpg" \
  -F "split=train" \
  -F "file=@image.jpg" \
  -F 'metadata={"camera_id":"cam001","temperature":72.5}'
```

### S3 Bucket Mirror

जब आप [Bucket Mirror](/roboflow/roboflow-hi/datasets/adding-data/upload-data-from-aws-gcp-and-azure/aws-s3-bucket.md) का उपयोग करके S3 bucket से images sync करते हैं, तो आप प्रत्येक image के साथ समान base name वाली एक `.json` file रखकर metadata जोड़ सकते हैं:

```
my-bucket/
  images/
    photo_001.jpg
    photo_001.json      # photo_001.jpg के लिए metadata
    photo_002.jpg
    photo_002.json      # photo_002.jpg के लिए metadata
```

JSON file में आपका metadata key-value pairs के रूप में होता है:

```json
{
    "camera_id": "cam001",
    "location": "warehouse-3",
    "capture": { "temperature": 72.5, "humidity": 45 }
}
```

**Nested objects को automatically** dot notation का उपयोग करके flatten किया जाता है। ऊपर का उदाहरण यह बनाता है:

| Key                   | Value           |
| --------------------- | --------------- |
| `camera_id`           | `"cam001"`      |
| `location`            | `"warehouse-3"` |
| `capture.temperature` | `72.5`          |
| `capture.humidity`    | `45`            |

#### Metadata file constraints

* Maximum file size: **256 KB**
* Valid JSON होना चाहिए
* `null` और `undefined` values फ़िल्टर कर दी जाती हैं

#### Update strategies

Bucket Mirror इस बात के लिए अलग-अलग strategies support करता है कि synced metadata, UI में या API के माध्यम से manually set किए गए metadata के साथ कैसे interact करे:

| Strategy                        | Behavior                                                                                                     |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **`mergeBucketWins`** (default) | दोनों sources को merge करता है। key conflicts होने पर bucket value जीतती है।                                 |
| **`mergeUserWins`**             | दोनों sources को merge करता है। key conflicts होने पर user-set value जीतती है।                               |
| **`overwrite`**                 | Bucket metadata existing सभी metadata को पूरी तरह replace कर देता है।                                        |
| **`untilFirstChange`**          | bucket से sync करता रहता है जब तक कोई user manually metadata edit नहीं करता, फिर update करना बंद कर देता है। |
| **`append`**                    | सिर्फ bucket से नए keys जोड़ता है। मौजूदा keys को कभी overwrite नहीं करता।                                   |

## Metadata के आधार पर खोजना

Metadata को [Asset Library](/roboflow/roboflow-hi/workspaces/asset-library.md)में index किया जाता है और search किया जा सकता है। Metadata values के आधार पर images filter करने के लिए search bar का उपयोग करें:

```
metadata.camera_id:"cam001"
metadata.quality_score>80
metadata.reviewed:true
```

आप metadata filters को अन्य search filters के साथ combine कर सकते हैं:

```
metadata.location:"warehouse-3" AND class:forklift
```

Asset Library आपके workspace में मौजूद चीज़ों के आधार पर metadata keys और values के लिए autocomplete भी प्रदान करता है।

## Key Naming Rules

Metadata keys को इन नियमों का पालन करना चाहिए:

| Rule                 | Detail                                                                 |
| -------------------- | ---------------------------------------------------------------------- |
| Allowed characters   | Letters (`a-z`, `A-Z`), numbers (`0-9`), underscores (`_`), dots (`.`) |
| First character      | एक letter, number, या underscore होना चाहिए                            |
| Forbidden characters | Forward slashes (`/`) allowed नहीं हैं                                 |

Valid keys: `camera_id`, `capture.temperature`, `_internal_ref`, `v2_score`

Invalid keys: `camera/id` (contains `/`), `.starts_with_dot` (starts with `.`), `has spaces` (contains spaces)

## Metadata vs. Tags

metadata और [tags](/roboflow/roboflow-hi/datasets/manage-datasets/add-tags-to-images.md) दोनों images को organize करने में मदद करते हैं, लेकिन इनके उद्देश्य अलग-अलग हैं:

|                        | Tags                                 | Metadata                                   |
| ---------------------- | ------------------------------------ | ------------------------------------------ |
| **संरचना**             | Simple labels                        | Key-value pairs                            |
| **Values**             | कोई value नहीं, केवल एक name         | String, number, या boolean                 |
| **इसके लिए सर्वोत्तम** | Categorization, workflow status      | Structured attributes, measurements        |
| **उदाहरण**             | `reviewed`, `v2`, `needs-annotation` | `temperature: 72.5`, `camera_id: "cam001"` |

आप एक ही image पर दोनों का उपयोग कर सकते हैं। उदाहरण के लिए, एक image को `reviewed` के रूप में tag करें और साथ ही `reviewer: "alice"` और `confidence: 0.95` को metadata के रूप में store करें।


---

# 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.roboflow.com/roboflow/roboflow-hi/datasets/adding-data/image-metadata.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.
