> 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/reference/hi/inference/inference-sdk/configuration.md).

# Configuration

## कॉन्फ़िगरेशन विकल्प

### कॉन्टेक्स्ट मैनेजर के साथ कॉन्फ़िगर करना

मेथड्स `use_configuration(...)` और `use_model(...)` को कॉन्टेक्स्ट मैनेजर में काम करने के लिए डिज़ाइन किया गया है। **एक बार कॉन्टेक्स्ट मैनेजर से बाहर निकलने पर, पुराने कॉन्फ़िग मान पुनर्स्थापित हो जाते हैं।**

```python
from inference_sdk import InferenceHTTPClient, InferenceConfiguration

image_url = "https://source.roboflow.com/pwYAXv9BTpqLyFfgQoPZ/u48G0UpWfk8giSw7wrU8/original.jpg"

custom_configuration = InferenceConfiguration(confidence_threshold=0.8)
# ROBOFLOW_API_KEY को अपने Roboflow API Key से बदलें
CLIENT = InferenceHTTPClient(
    api_url="http://localhost:9001",
    api_key="ROBOFLOW_API_KEY"
)

with CLIENT.use_configuration(custom_configuration):
    _ = CLIENT.infer(image_url, model_id="soccer-players-5fuqs/1")

with CLIENT.use_model("soccer-players-5fuqs/1"):
    _ = CLIENT.infer(image_url)

# context manager से बाहर निकलने के बाद - परिवर्तन वापस हो जाते हैं और `model_id` अभी भी आवश्यक है
_ = CLIENT.infer(image_url, model_id="soccer-players-5fuqs/1")
```

जैसा कि आप देख सकते हैं, `model_id` एक prediction method के लिए तभी आवश्यक है जब कोई डिफ़ॉल्ट मॉडल कॉन्फ़िगर न हो।

{% hint style="info" %}
मॉडल ID इस स्ट्रिंग से बनती है `<project_id>/<version_id>`. देखें [Workspace और Project IDs](/reference/hi/authentication/authentication/workspace-and-project-ids.md) इन जानकारियों को खोजने के लिए।
{% endhint %}

### कॉन्फ़िगरेशन को एक बार सेट करना और अगला परिवर्तन होने तक उसका उपयोग करना

मेथड्स `configure(...)` और `select_model(...)` क्लाइंट की स्थिति बदलते हैं और यह परिवर्तन अगले बदलाव तक बना रहता है।

```python
from inference_sdk import InferenceHTTPClient, InferenceConfiguration

image_url = "https://source.roboflow.com/pwYAXv9BTpqLyFfgQoPZ/u48G0UpWfk8giSw7wrU8/original.jpg"

custom_configuration = InferenceConfiguration(confidence_threshold=0.8)
# ROBOFLOW_API_KEY को अपने Roboflow API Key से बदलें
CLIENT = InferenceHTTPClient(
    api_url="http://localhost:9001",
    api_key="ROBOFLOW_API_KEY"
)

CLIENT.configure(custom_configuration)
CLIENT.infer(image_url, model_id="soccer-players-5fuqs/1")

# कस्टम कॉन्फ़िगरेशन अभी भी प्रभावी है
CLIENT.select_model(model_id="soccer-players-5fuqs/1")
_ = CLIENT.infer(image_url)

# कस्टम कॉन्फ़िगरेशन और चुना गया मॉडल - अभी भी प्रभावी हैं
_ = CLIENT.infer(image_url)
```

आप इसे `chain` मोड में भी प्रारंभ कर सकते हैं:

```python
from inference_sdk import InferenceHTTPClient, InferenceConfiguration

# ROBOFLOW_API_KEY को अपने Roboflow API Key से बदलें
CLIENT = InferenceHTTPClient(api_url="http://localhost:9001", api_key="ROBOFLOW_API_KEY") \
    .select_model("soccer-players-5fuqs/1")
```

### ओवरराइड करना `model_id` किसी विशिष्ट कॉल के लिए

`model_id` को किसी विशिष्ट कॉल के लिए ओवरराइड किया जा सकता है:

```python
from inference_sdk import InferenceHTTPClient

image_url = "https://source.roboflow.com/pwYAXv9BTpqLyFfgQoPZ/u48G0UpWfk8giSw7wrU8/original.jpg"

# ROBOFLOW_API_KEY को अपने Roboflow API Key से बदलें
CLIENT = InferenceHTTPClient(api_url="http://localhost:9001", api_key="ROBOFLOW_API_KEY") \
    .select_model("soccer-players-5fuqs/1")

_ = CLIENT.infer(image_url, model_id="another-model/1")
```

## क्लाइंट कॉन्फ़िगरेशन के बारे में विवरण

`InferenceHTTPClient` प्रदान करता है `InferenceConfiguration` डैटाक्लास, जो पूरी कॉन्फ़िगरेशन को संग्रहीत करती है।

```python
from inference_sdk import InferenceConfiguration
```

इस कॉन्फ़िगरेशन में फ़ील्ड्स को बदलने से क्लाइंट का व्यवहार (और मॉडल को सर्व करने वाले API का) बदल जाता है। अलग-अलग फ़ील्ड्स अलग-अलग संदर्भों में उपयोग होती हैं। विशेष रूप से:

### क्लासिफिकेशन मॉडल

* `visualize_predictions`: विज़ुअलाइज़ेशन को सक्षम / अक्षम करने का फ़्लैग
* `confidence_threshold` के रूप में `confidence`
* `stroke_width`: विज़ुअलाइज़ेशन में स्ट्रोक की चौड़ाई
* `disable_preproc_auto_orientation`, `disable_preproc_contrast`, `disable_preproc_grayscale`, `disable_preproc_static_crop` सर्वर-साइड प्री-प्रोसेसिंग को बदलने के लिए
* `disable_active_learning` को रोकने के लिए [Active Learning](https://docs.roboflow.com/deployment/monitoring-and-analytics/active-learning) फ़ीचर को datapoint पंजीकृत करने से (उदाहरण के लिए, मॉडल का परीक्षण करते समय यह उपयोगी हो सकता है)
* `active_learning_target_dataset` - जब किसी विशिष्ट मॉडल से inference किया जा रहा हो (मान लीजिए `project_a/1`) और आप डेटा को किसी अन्य प्रोजेक्ट में सहेजना चाहते हों `project_b`, तो दूसरे की ओर इस पैरामीटर से संकेत करना चाहिए। **ध्यान दें कि आप अलग-अलग प्रकार के मॉडल का उपयोग नहीं कर सकते `project_a` और `project_b`में; यदि ऐसा होता है, तो डेटा पंजीकृत नहीं होगा।**
* `source`: एक वैकल्पिक स्ट्रिंग जो inference call पर एक "source" एट्रिब्यूट सेट करती है। यदि [model monitoring](https://docs.roboflow.com/deployment/monitoring-and-analytics/model-monitoring)का उपयोग किया जा रहा हो, तो यह inference request के साथ लॉग होती है, ताकि आप किसी विशेष स्रोत से आने वाले inference requests को फ़िल्टर या क्वेरी कर सकें, उदाहरण के लिए यह पहचानने के लिए कि कौन-सा एप्लिकेशन, सिस्टम, या डिप्लॉयमेंट अनुरोध कर रहा है।
* `source_info`: एक वैकल्पिक स्ट्रिंग जो inference call पर एक अतिरिक्त "source\_info" एट्रिब्यूट सेट करती है, उदाहरण के लिए किसी ऐप में किसी उप-घटक की पहचान करने के लिए।

### ऑब्जेक्ट डिटेक्शन मॉडल

* `visualize_predictions`: विज़ुअलाइज़ेशन को सक्षम / अक्षम करने का फ़्लैग
* `visualize_labels`: यदि विज़ुअलाइज़ेशन सक्षम है, तो लेबल विज़ुअलाइज़ेशन को सक्षम / अक्षम करने का फ़्लैग
* `confidence_threshold` के रूप में `confidence`
* `class_filter` क्लासों की एक सूची को फ़िल्टर करने के लिए
* `class_agnostic_nms`: यह नियंत्रित करने का फ़्लैग कि NMS class-agnostic है या नहीं
* `fix_batch_size`
* `iou_threshold`: NMS IoU threshold निर्धारित करने के लिए
* `stroke_width`: विज़ुअलाइज़ेशन में स्ट्रोक की चौड़ाई
* `max_detections`: मॉडल से लौटाई जाने वाली अधिकतम detections
* `max_candidates`: मॉडल से post-processing के लिए अधिकतम candidates
* `disable_preproc_auto_orientation`, `disable_preproc_contrast`, `disable_preproc_grayscale`, `disable_preproc_static_crop` सर्वर-साइड प्री-प्रोसेसिंग को बदलने के लिए
* `disable_active_learning`, `active_learning_target_dataset`, `source`, `source_info` - जैसा कि ऊपर वर्णित है

### कीपॉइंट डिटेक्शन मॉडल

* `visualize_predictions`: विज़ुअलाइज़ेशन को सक्षम / अक्षम करने का फ़्लैग
* `visualize_labels`: यदि विज़ुअलाइज़ेशन सक्षम है, तो लेबल विज़ुअलाइज़ेशन को सक्षम / अक्षम करने का फ़्लैग
* `confidence_threshold` के रूप में `confidence`
* `keypoint_confidence_threshold` (जैसा कि `keypoint_confidence`) मॉडल confidence के आधार पर detected keypoints को फ़िल्टर करने के लिए
* `class_filter` object classes की एक सूची को फ़िल्टर करने के लिए
* `class_agnostic_nms`: यह नियंत्रित करने का फ़्लैग कि NMS class-agnostic है या नहीं
* `fix_batch_size`
* `iou_threshold`: NMS IoU threshold निर्धारित करने के लिए
* `stroke_width`: विज़ुअलाइज़ेशन में स्ट्रोक की चौड़ाई
* `max_detections`: मॉडल से लौटाई जाने वाली अधिकतम detections
* `max_candidates`: मॉडल से post-processing के लिए अधिकतम candidates
* `disable_preproc_auto_orientation`, `disable_preproc_contrast`, `disable_preproc_grayscale`, `disable_preproc_static_crop` सर्वर-साइड प्री-प्रोसेसिंग को बदलने के लिए
* `disable_active_learning`, `active_learning_target_dataset`, `source`, `source_info` - जैसा कि ऊपर वर्णित है

### इंस्टेंस सेगमेंटेशन मॉडल

* `visualize_predictions`: विज़ुअलाइज़ेशन को सक्षम / अक्षम करने का फ़्लैग
* `visualize_labels`: यदि विज़ुअलाइज़ेशन सक्षम है, तो लेबल विज़ुअलाइज़ेशन को सक्षम / अक्षम करने का फ़्लैग
* `confidence_threshold` के रूप में `confidence`
* `class_filter` क्लासों की एक सूची को फ़िल्टर करने के लिए
* `class_agnostic_nms`: यह नियंत्रित करने का फ़्लैग कि NMS class-agnostic है या नहीं
* `fix_batch_size`
* `iou_threshold`: NMS IoU threshold निर्धारित करने के लिए
* `stroke_width`: विज़ुअलाइज़ेशन में स्ट्रोक की चौड़ाई
* `max_detections`: मॉडल से लौटाई जाने वाली अधिकतम detections
* `max_candidates`: मॉडल से post-processing के लिए अधिकतम candidates
* `disable_preproc_auto_orientation`, `disable_preproc_contrast`, `disable_preproc_grayscale`, `disable_preproc_static_crop` सर्वर-साइड प्री-प्रोसेसिंग को बदलने के लिए
* `mask_decode_mode`
* `tradeoff_factor`
* `disable_active_learning`, `active_learning_target_dataset`, `source`, `source_info` - जैसा कि ऊपर वर्णित है

### क्लाइंट का कॉन्फ़िगरेशन

* `output_visualisation_format`: इनमें से एक `VisualisationResponseFormat.BASE64`, `VisualisationResponseFormat.NUMPY`, `VisualisationResponseFormat.PILLOW`. चूँकि सर्वर-साइड विज़ुअलाइज़ेशन सक्षम है, आप चुन सकते हैं कि आउटपुट में कौन-सा फ़ॉर्मैट उपयोग किया जाए।
* `client_downsizing_disabled`: सेट करें `False` यदि आप क्लाइंट-साइड downsizing करना चाहते हैं। डिफ़ॉल्ट `True`. क्लाइंट-साइड scaling केवल inference के लिए इनपुट को down-scale (aspect ratio बनाए रखते हुए) करने के लिए होती है, ताकि इंटरनेट कनेक्शन का अधिक कुशलता से उपयोग हो सके (image manipulation / transcoding की कीमत पर)। target size निर्धारित करने के लिए मॉडल input size की जानकारी उपयोग की जाती है; यदि उपलब्ध न हो, `default_max_input_size` का उपयोग किया जाता है।
* `max_concurrent_requests`: अधिकतम समानांतर अनुरोधों की संख्या जो शुरू की जा सकती है
* `max_batch_size`: किसी एक अनुरोध में इंजेक्ट किए जा सकने वाले तत्वों की अधिकतम संख्या
* `workflow_run_retries_enabled`: यह फ़्लैग तय करता है कि Workflows निष्पादन में अस्थायी त्रुटियों पर पुनः प्रयास किया जाए या नहीं। डिफ़ॉल्ट रूप से `true` और डिफ़ॉल्ट को environment variable `WORKFLOW_RUN_RETRIES_ENABLED`.

### Workflows निष्पादन का कॉन्फ़िगरेशन

* `profiling_directory`: उस स्थान को निर्दिष्ट करता है जहाँ Workflows profiler traces सहेजे जाते हैं। डिफ़ॉल्ट रूप से, यह `./inference_profiling` डायरेक्टरी है।
