> 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/models/hi/supported-models/yolov12.md).

# YOLOv12

हम अपने [सर्वरलेस क्लाउड API](https://docs.roboflow.com/deployment/roboflow-cloud/serverless-api) के माध्यम से YOLOv12 ऑब्जेक्ट डिटेक्शन इन्फ़रेंसिंग का समर्थन करते हैं। YOLOv12 पाँच आकारों में समर्थित है (`n`, `s`, `m`, `l`, `x`) ऑब्जेक्ट डिटेक्शन कार्य के लिए।

स्व-होस्टेड डिप्लॉयमेंट के लिए देखें [Roboflow Inference](https://docs.roboflow.com/deployment/self-hosted/self-hosted).

YOLOv12 इनपुट आकार तब सेट किया जाता है जब आप Roboflow पर अपना मॉडल प्रशिक्षित करते हैं (सामान्य मान: 640x640 या 1280x1280)।

## YOLOv12 API

{% stepper %}
{% step %}

### अपनी API कुंजी प्राप्त करें

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

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

{% endstep %}

{% step %}

### निर्भरताएँ इंस्टॉल करें

इंस्टॉल करें [Inference SDK](https://docs.roboflow.com/reference/inference/inference-sdk) और [supervision](https://supervision.roboflow.com/) भविष्यवाणियों को डिकोड और विज़ुअलाइज़ करने के लिए:

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

{% endstep %}

{% step %}

### मॉडल चलाएँ

यह उदाहरण एक सार्वजनिक YOLOv12 मॉडल चलाता है, जिसे एक [screws डेटासेट](https://universe.roboflow.com/erik-pe6au/rf-bolts) (screw, flat-washer, hex-nut)। अपने स्वयं के `{workspace}/{model-slug}` को अपने प्रशिक्षित weights चलाने के लिए बदलें (देखें [संस्करण, प्रशिक्षण, और मॉडल](/models/hi/versions-trainings-and-models.md)).

```python
import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient, InferenceConfiguration

image = sv.load_image_from_url("https://media.roboflow.com/docs/bolts.jpg")

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
).configure(InferenceConfiguration(api_key_transport="header"))
result = client.infer(image, model_id="erik-pe6au/bolts-uzqzc-4-yolo12s-t1")

detections = sv.Detections.from_inference(result)

annotated = sv.BoxAnnotator().annotate(image.copy(), detections)

cv2.imwrite("annotated.png", annotated)
```

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

{% hint style="info" %}
सेट करें `api_url` को अपने डिप्लॉयमेंट लक्ष्य से मेल कराने के लिए:

* `https://serverless.roboflow.com` Serverless Cloud API के लिए।
* `http://localhost:9001` एक स्थानीय [Inference](https://docs.roboflow.com/deployment/self-hosted/self-hosted) सर्वर।
* आपका [समर्पित डिप्लॉयमेंट](https://docs.roboflow.com/deployment/roboflow-cloud/dedicated-deployments) एक निजी endpoint के लिए URL।
  {% endhint %}
