> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-hi/deploy/supported-models/roboflow-3.md).

# Roboflow 3.0

## Roboflow 3.0 Object Detection

Roboflow 3.0, Roboflow की इन-हाउस model architecture है। आप Roboflow platform पर Roboflow 3.0 models train करते हैं और उन्हें के माध्यम से deploy करते हैं [Serverless Hosted API](/roboflow/roboflow-hi/deploy/serverless-hosted-api-v2.md)। नीचे दिया गया sample Roboflow का सार्वजनिक [COCO model](https://universe.roboflow.com/microsoft/coco) (`coco/3`) ताकि आप इसे तुरंत आज़मा सकें। self-hosted deployment के लिए, देखें [Roboflow Inference](https://inference.roboflow.com/).

### कोड नमूना

{% stepper %}
{% step %}
**अपनी API Key प्राप्त करें**

एक Roboflow खाता बनाएं, अपनी key यहाँ पर ढूँढें [Roboflow API settings page](https://app.roboflow.com/settings/api) और इसे अपने shell में उपलब्ध कराएँ:

```bash
export ROBOFLOW_API_KEY="your-key-here"
```

{% endstep %}

{% step %}
**निर्भरताएँ इंस्टॉल करें**

इंस्टॉल करें [Inference SDK](https://inference.roboflow.com/) और [supervision](https://supervision.roboflow.com/):

```bash
pip install inference-sdk supervision
```

{% endstep %}

{% step %}
**मॉडल चलाएँ**

एक sample image पर detection चलाएँ और boxes तथा labels annotate करें:

```python
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/quickstart/traffic.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)
result = client.infer(image, model_id="coco/3")

detections = sv.Detections.from_inference(result)

annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections)
cv2.imwrite("output.png", annotated)
```

<figure><img src="/files/f4f7770155e77bc4cd7b120175e7b386e6f64559" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
सेट करें `api_url` को अपने deployment target से मिलाएँ:

* `https://serverless.roboflow.com` Serverless Hosted API के लिए।
* `http://localhost:9001` एक local [Inference](https://inference.roboflow.com/) server.
* आपका [Dedicated Deployment](/roboflow/roboflow-hi/deploy/dedicated-deployments.md) एक private endpoint के लिए URL.
  {% endhint %}

## Roboflow 3.0 Instance Segmentation

एक Roboflow 3.0 instance segmentation model train करें, फिर बदलें `your-project/1` अपने `{workspace}/{model-slug}` ID (देखें [Versions, Trainings, and Models](/roboflow/roboflow-hi/train/versions-trainings-and-models.md))। अपना API key सेट करें और ऊपर दिखाए अनुसार dependencies install करें।

### कोड नमूना

```python
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/quickstart/traffic.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)
# No pretrained aliases: अपना model train करें और "your-project/1" को अपने model ID से बदलें।
result = client.infer(image, model_id="your-project/1")

detections = sv.Detections.from_inference(result)

annotated = sv.MaskAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections)
cv2.imwrite("output.png", annotated)
```

## Roboflow 3.0 Keypoint Detection

यह उदाहरण सार्वजनिक [rf-handpose](https://universe.roboflow.com/erik-pe6au/rf-handpose) hand keypoint model चलाता है, फिर 21-बिंदु hand skeleton बनाता है। अपना `{workspace}/{model-slug}`. अपना API key सेट करें और ऊपर दिखाए अनुसार dependencies install करें।

### कोड नमूना

```python
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/docs/hand.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)
result = client.infer(image, model_id="rf-handpose/1")

key_points = sv.KeyPoints.from_inference(result)

# Hand skeleton: कलाई (0), अंगूठा (1-4), तर्जनी (5-8), मध्यमा (9-12), अनामिका (13-16), कनिष्ठा (17-20)
hand_edges = [
    (0, 1), (1, 2), (2, 3), (3, 4),
    (0, 5), (5, 6), (6, 7), (7, 8),
    (5, 9), (9, 10), (10, 11), (11, 12),
    (9, 13), (13, 14), (14, 15), (15, 16),
    (13, 17), (17, 18), (18, 19), (19, 20), (0, 17),
]
annotated = image.copy()
vertices = key_points.xy[0].astype(int)
for start, end in hand_edges:
    cv2.line(annotated, tuple(vertices[start]), tuple(vertices[end]), (255, 0, 0), 2)
annotated = sv.VertexAnnotator(color=sv.Color.GREEN, radius=5).annotate(annotated, key_points)
cv2.imwrite("output.png", annotated)
```

<figure><img src="/files/6c8ed24669f6f5a9af4d580596a07f69390b5f89" alt=""><figcaption></figcaption></figure>

## Roboflow 3.0 Classification

Classification responses में confidence के साथ class predictions की एक सूची होती है, इसलिए visualization लागू नहीं होती। top class को सीधे response से पढ़ें। बदलें `your-project/1` इसे अपने trained model ID से बदलें, और अपना API key सेट करें तथा ऊपर दिखाए अनुसार dependencies install करें।

### कोड नमूना

```python
import os
import cv2
import numpy as np
import requests
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/quickstart/traffic.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)
# No pretrained aliases: अपना model train करें और "your-project/1" को अपने model ID से बदलें।
result = client.infer(image, model_id="your-project/1")

print(f"Top class: {result['top']} ({result['confidence']:.4f})")
```
