> 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/deployment/hi/legacy/legacy-serverless/keypoint-detection.md).

# Keypoint Detection

legacy Roboflow hosted API पर होस्ट किए गए अपने keypoint detection models पर inference चलाएँ।

{% tabs %}
{% tab title="Python" %}
हमारी होस्ट की गई API के माध्यम से Python का उपयोग करके इन्फ़रेंस चलाने के लिए, उपयोग करें `roboflow` Python पैकेज:

```python
from roboflow import Roboflow
rf = Roboflow(api_key="API_KEY")
project = rf.workspace().project("MODEL_ENDPOINT")
model = project.version(VERSION).models()[0]

# एक स्थानीय इमेज पर इन्फ़र करें
print(model.predict("your_image.jpg", confidence=40, overlap=30).json())

# अपने पूर्वानुमान को विज़ुअलाइज़ करें
# model.predict("your_image.jpg", confidence=40, overlap=30).save("prediction.jpg")

# कहीं और होस्ट की गई इमेज पर इन्फ़र करें
# print(model.predict("URL_OF_YOUR_IMAGE", hosted=True, confidence=40, overlap=30).json())
```

{% endtab %}

{% tab title="cURL" %}
**लिनक्स या मैकओएस**

नामक एक स्थानीय फ़ाइल के लिए JSON पूर्वानुमान प्राप्त करना `YOUR_IMAGE.jpg`:

```bash
base64 YOUR_IMAGE.jpg | curl -d @- \\
-H "Authorization: Bearer YOUR_KEY" \\
"https://serverless.roboflow.com/your-model/42"
```

इसके URL के माध्यम से वेब पर कहीं और होस्ट की गई इमेज पर इन्फ़र करना (इसे [URL-एन्कोड करना न भूलें](https://www.urlencoder.org/)):

```bash
curl -X POST \\
-H "Authorization: Bearer YOUR_KEY" \\
"https://serverless.roboflow.com/your-model/42?\
image=https%3A%2F%2Fi.imgur.com%2FPEEvqPN.png"
```

**Windows**

आपको इंस्टॉल करना होगा [Windows के लिए curl](https://curl.se/windows/) और [Windows के लिए GNU का base64 टूल](http://gnuwin32.sourceforge.net/packages/coreutils.htm). ऐसा करने का सबसे आसान तरीका है [git for Windows इंस्टॉलर](https://git-scm.com/downloads) जिसमें यह भी शामिल है `curl` और `base64` कमांड-लाइन टूल्स, जब आप इंस्टॉलेशन के दौरान "Use Git and optional Unix tools from the Command Prompt" चुनते हैं।

फिर आप ऊपर दिए गए वही कमांड उपयोग कर सकते हैं।
{% endtab %}

{% tab title="Javascript" %}
**Node.js**

इन उदाहरणों में अंतर्निहित `fetch` API का उपयोग किया गया है। यह Node.js 18 और उसके बाद के संस्करणों तथा आधुनिक ब्राउज़रों में काम करता है, इसलिए इंस्टॉल करने के लिए कोई dependency नहीं है।

**एक स्थानीय इमेज पर इन्फ़र करना**

```javascript
const fs = require("fs");

const image = fs.readFileSync("YOUR_IMAGE.jpg", {
    encoding: "base64"
});

fetch("https://serverless.roboflow.com/your-model/42", {
    method: "POST",
    headers: {
        "Authorization": "Bearer YOUR_KEY",
        "Content-Type": "application/x-www-form-urlencoded"
    },
    body: image
})
    .then((response) => {
        if (!response.ok) throw new Error("Request failed with status " + response.status);
        return response.json();
    })
    .then((data) => {
        console.log(data);
    })
    .catch((error) => {
        console.log(error.message);
    });
```

**URL के माध्यम से कहीं और होस्ट की गई इमेज पर इन्फ़र करना**

```javascript
fetch(
    "https://serverless.roboflow.com/your-model/42?image=" +
        encodeURIComponent("https://i.imgur.com/PEEvqPN.png"),
    {
        method: "POST",
        headers: {
            "Authorization": "Bearer YOUR_KEY"
        }
    }
)
    .then((response) => {
        if (!response.ok) throw new Error("Request failed with status " + response.status);
        return response.json();
    })
    .then((data) => {
        console.log(data);
    })
    .catch((error) => {
        console.log(error.message);
    });
```

**वेब**

हमारे पास रीयलटाइम डिवाइस-पर इन्फ़रेंस उपलब्ध है `roboflow.js`; देखें [यहाँ दस्तावेज़ीकरण](/deployment/hi/self-hosted/sdks/web-browser.md).
{% endtab %}

{% tab title="Swift/iOS" %}
**Swift**

**एक स्थानीय इमेज पर इन्फ़र करना**

```swift
import UIKit

// इमेज लोड करें और Base64 में बदलें
let image = UIImage(named: "your-image-path") // अपलोड करने के लिए इमेज का पथ, जैसे: image.jpg
let imageData = image?.jpegData(compressionQuality: 1)
let fileContent = imageData?.base64EncodedString()
let postData = fileContent!.data(using: .utf8)

// API_KEY, मॉडल, और मॉडल वर्शन के साथ इन्फ़रेंस सर्वर अनुरोध प्रारंभ करें
var request = URLRequest(url: URL(string: "https://serverless.roboflow.com/your-model/your-model-version?name=YOUR_IMAGE.jpg")!,timeoutInterval: Double.infinity)
request.setValue("Bearer YOUR_APIKEY", forHTTPHeaderField: "Authorization")
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData

// पोस्ट अनुरोध निष्पादित करें
URLSession.shared.dataTask(with: request, completionHandler: { data, response, error in
    
    // प्रतिक्रिया को String में पार्स करें
    guard let data = data else {
        print(String(describing: error))
        return
    }
    
    // प्रतिक्रिया String को Dictionary में बदलें
    do {
        let dict = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any]
    } catch {
        print(error.localizedDescription)
    }
    
    // String प्रतिक्रिया प्रिंट करें
    print(String(data: data, encoding: .utf8)!)
}).resume()
```

**ऑब्जेक्टिव-सी**

[ऑब्जेक्टिव-सी स्निपेट का अनुरोध करने के लिए यहाँ क्लिक करें।](https://app.roboflow.com/request/snippet.inference-objc)
{% endtab %}

{% tab title="Android" %}
**Kotlin**

**एक स्थानीय इमेज पर इन्फ़र करना**

```kotlin
import java.io.*
import java.net.HttpURLConnection
import java.net.URL
import java.nio.charset.StandardCharsets
import java.util.*

fun main() {
    // इमेज पथ प्राप्त करें
    val filePath = System.getProperty("user.dir") + System.getProperty("file.separator") + "YOUR_IMAGE.jpg"
    val file = File(filePath)

    // Base64 एन्कोड
    val encodedFile: String
    val fileInputStreamReader = FileInputStream(file)
    val bytes = ByteArray(file.length().toInt())
    fileInputStreamReader.read(bytes)
    encodedFile = String(Base64.getEncoder().encode(bytes), StandardCharsets.US_ASCII)
    val API_KEY = "" // आपका API Key
    val MODEL_ENDPOINT = "dataset/v" // मॉडल endpoint सेट करें (Dataset URL में पाया जाता है)

    // URL बनाएं
    val uploadURL ="https://serverless.roboflow.com/" + MODEL_ENDPOINT + "?name=YOUR_IMAGE.jpg";

    // HTTP अनुरोध
    var connection: HttpURLConnection? = null
    try {
        // URL से कनेक्शन कॉन्फ़िगर करें
        val url = URL(uploadURL)
        connection = url.openConnection() as HttpURLConnection
        connection.requestMethod = "POST"
        connection.setRequestProperty("Content-Type",
                "application/x-www-form-urlencoded")
        connection.setRequestProperty("Content-Length",
                Integer.toString(encodedFile.toByteArray().size))
        connection.setRequestProperty("Authorization", "Bearer " + API_KEY)
        connection.setRequestProperty("Content-Language", "en-US")
        connection.useCaches = false
        connection.doOutput = true

        // अनुरोध भेजें
        val wr = DataOutputStream(
                connection.outputStream)
        wr.writeBytes(encodedFile)
        wr.close()

        // प्रतिक्रिया प्राप्त करें
        val stream = connection.inputStream
        val reader = BufferedReader(InputStreamReader(stream))
        var line: String?
        while (reader.readLine().also { line = it } != null) {
            println(line)
        }
        reader.close()
    } catch (e: Exception) {
        e.printStackTrace()
    } finally {
        connection?.disconnect()
    }
}
main()
```

**URL के माध्यम से कहीं और होस्ट की गई इमेज पर इन्फ़र करना**

```kotlin
import java.io.BufferedReader
import java.io.DataOutputStream
import java.io.InputStreamReader
import java.net.HttpURLConnection
import java.net.URL
import java.net.URLEncoder

fun main() {
    val imageURL = "https://i.imgur.com/PEEvqPN.png" // इमेज URL बदलें
    val API_KEY = "" // आपका API Key
    val MODEL_ENDPOINT = "dataset/v" // मॉडल endpoint सेट करें

    // अपलोड URL
    val uploadURL = "https://serverless.roboflow.com/" + MODEL_ENDPOINT + "?image=" + URLEncoder.encode(imageURL, "utf-8");

    // HTTP अनुरोध
    var connection: HttpURLConnection? = null
    try {
        // URL से कनेक्शन कॉन्फ़िगर करें
        val url = URL(uploadURL)
        connection = url.openConnection() as HttpURLConnection
        connection.requestMethod = "POST"
        connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded")
        connection.setRequestProperty("Content-Length", Integer.toString(uploadURL.toByteArray().size))
        connection.setRequestProperty("Authorization", "Bearer " + API_KEY)
        connection.setRequestProperty("Content-Language", "en-US")
        connection.useCaches = false
        connection.doOutput = true

        // अनुरोध भेजें
        val wr = DataOutputStream(connection.outputStream)
        wr.writeBytes(uploadURL)
        wr.close()

        // प्रतिक्रिया प्राप्त करें
        val stream = connection.inputStream
        val reader = BufferedReader(InputStreamReader(stream))
        var line: String?
        while (reader.readLine().also { line = it } != null) {
            println(line)
        }
        reader.close()
    } catch (e: Exception) {
        e.printStackTrace()
    } finally {
        connection?.disconnect()
    }
}

main()
```

**Java**

**एक स्थानीय इमेज पर इन्फ़र करना**

```java
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Base64;

public class InferenceLocal {
    public static void main(String[] args) throws IOException {
        // इमेज पथ प्राप्त करें
        String filePath = System.getProperty("user.dir") + System.getProperty("file.separator") + "YOUR_IMAGE.jpg";
        File file = new File(filePath);

        // Base64 एन्कोड
        String encodedFile;
        FileInputStream fileInputStreamReader = new FileInputStream(file);
        byte[] bytes = new byte[(int) file.length()];
        fileInputStreamReader.read(bytes);
        encodedFile = new String(Base64.getEncoder().encode(bytes), StandardCharsets.US_ASCII);

        String API_KEY = ""; // आपका API Key
        String MODEL_ENDPOINT = "dataset/v"; // मॉडल endpoint

        // URL बनाएं
        String uploadURL = "https://serverless.roboflow.com/" + MODEL_ENDPOINT + "?name=YOUR_IMAGE.jpg";

        // HTTP अनुरोध
        HttpURLConnection connection = null;
        try {
            // URL से कनेक्शन कॉन्फ़िगर करें
            URL url = new URL(uploadURL);
            connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

            connection.setRequestProperty("Content-Length", Integer.toString(encodedFile.getBytes().length));
            connection.setRequestProperty("Authorization", "Bearer " + API_KEY);
            connection.setRequestProperty("Content-Language", "en-US");
            connection.setUseCaches(false);
            connection.setDoOutput(true);

            // अनुरोध भेजें
            DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
            wr.writeBytes(encodedFile);
            wr.close();

            // प्रतिक्रिया प्राप्त करें
            InputStream stream = connection.getInputStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
            String line;
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }
            reader.close();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (connection != null) {
                connection.disconnect();
            }
        }

    }

}
```

**URL के माध्यम से कहीं और होस्ट की गई इमेज पर इन्फ़र करना**

```java
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

public class InferenceHosted {
    public static void main(String[] args) {
        String imageURL = "https://i.imgur.com/PEEvqPN.png"; // इमेज URL बदलें
        String API_KEY = ""; // आपका API Key
        String MODEL_ENDPOINT = "dataset/v"; // मॉडल endpoint

        // अपलोड URL
        String uploadURL = "https://serverless.roboflow.com/" + MODEL_ENDPOINT + "?image="
                + URLEncoder.encode(imageURL, StandardCharsets.UTF_8);

        // HTTP अनुरोध
        HttpURLConnection connection = null;
        try {
            // URL से कनेक्शन कॉन्फ़िगर करें
            URL url = new URL(uploadURL);
            connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

            connection.setRequestProperty("Content-Length", Integer.toString(uploadURL.getBytes().length));
            connection.setRequestProperty("Authorization", "Bearer " + API_KEY);
            connection.setRequestProperty("Content-Language", "en-US");
            connection.setUseCaches(false);
            connection.setDoOutput(true);

            // अनुरोध भेजें
            DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
            wr.writeBytes(uploadURL);
            wr.close();

            // प्रतिक्रिया प्राप्त करें
            InputStream stream = connection.getInputStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
            String line;
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }
            reader.close();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (connection != null) {
                connection.disconnect();
            }
        }
    }
}
```

{% endtab %}

{% tab title="Ruby" %}
**Gemfile**

{% code title="Gemfile" %}

```ruby
source "https://rubygems.org"

gem "httparty", "~> 0.18.1"
gem "base64", "~> 0.1.0"
gem "cgi", "~> 0.2.1"
```

{% endcode %}

**Gemfile.lock**

{% code title="Gemfile.lock" %}

```ruby
GEM
  remote: https://rubygems.org/
  specs:
    base64 (0.1.0)
    cgi (0.2.1)
    httparty (0.18.1)
      mime-types (~> 3.0)
      multi_xml (>= 0.5.2)
    mime-types (3.3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2021.0225)
    multi_xml (0.6.0)

PLATFORMS
  x64-mingw32
  x86_64-linux

DEPENDENCIES
  base64 (~> 0.1.0)
  cgi (~> 0.2.1)
  httparty (~> 0.18.1)

BUNDLED WITH
   2.2.15
```

{% endcode %}

**एक स्थानीय इमेज पर इन्फ़र करना**

```ruby
require 'base64'
require 'httparty'

encoded = Base64.encode64(File.open("YOUR_IMAGE.jpg", "rb").read)
model_endpoint = "dataset/v" # मॉडल endpoint सेट करें
api_key = "" # यहाँ आपका API KEY

params = "?name=YOUR_IMAGE.jpg"

response = HTTParty.post(
    "https://serverless.roboflow.com/" + model_endpoint + params,
    body: encoded, 
    headers: {
    'Authorization' => "Bearer " + api_key,
    'Content-Type' => 'application/x-www-form-urlencoded',
    'charset' => 'utf-8'
  })

  puts response

 
```

**URL के माध्यम से कहीं और होस्ट की गई इमेज पर इन्फ़र करना**

```ruby
require 'httparty'
require 'cgi'

model_endpoint = "dataset/v" # मॉडल endpoint सेट करें
api_key = "" # यहाँ आपका API KEY
img_url = "https://i.imgur.com/PEEvqPN.png" # URL बनाएं

img_url = CGI::escape(img_url)

params =  "?image=" + img_url

response = HTTParty.post(
    "https://serverless.roboflow.com/" + model_endpoint + params,
    headers: {
    'Authorization' => "Bearer " + api_key,
    'Content-Type' => 'application/x-www-form-urlencoded',
    'charset' => 'utf-8'
  })

puts response
```

{% endtab %}

{% tab title="PHP" %}
**एक स्थानीय इमेज पर इन्फ़र करना**

```php
<?php

// इमेज को Base64 में एन्कोड करें
$data = base64_encode(file_get_contents("YOUR_IMAGE.jpg"));

$api_key = ""; // API Key सेट करें
$model_endpoint = "dataset/v"; // मॉडल endpoint सेट करें (Dataset URL में पाया जाता है)

// HTTP अनुरोध के लिए URL
$url = "https://serverless.roboflow.com/" . $model_endpoint
. "?name=YOUR_IMAGE.jpg";

// HTTP अनुरोध सेटअप करें + भेजें
$options = array(
  'http' => array (
    'header' => "Content-type: application/x-www-form-urlencoded\r\n"
              . "Authorization: Bearer " . $api_key . "\r\n",
    'method'  => 'POST',
    'content' => $data
  ));

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
?>
```

**URL के माध्यम से कहीं और होस्ट की गई इमेज पर इन्फ़र करना**

```php
<?php

$api_key = ""; // API Key सेट करें
$model_endpoint = "dataset/v"; // मॉडल endpoint सेट करें (Dataset URL में पाया जाता है)
$img_url = "https://i.imgur.com/PEEvqPN.png";

// HTTP अनुरोध के लिए URL
$url =  "https://serverless.roboflow.com/" . $model_endpoint
. "?image=" . urlencode($img_url);

// HTTP अनुरोध सेटअप करें + भेजें
$options = array(
  'http' => array (
    'header' => "Content-type: application/x-www-form-urlencoded\r\n"
              . "Authorization: Bearer " . $api_key . "\r\n",
    'method'  => 'POST'
  ));

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
?>
```

{% endtab %}

{% tab title="Go" %}
**एक स्थानीय इमेज पर इन्फ़र करना**

```go
package main

import (
    "bufio"
    "encoding/base64"
    "fmt"
    "io/ioutil"
    "os"
	"net/http"
	"strings"
)

func main() {
	api_key := ""  // आपका API Key
	model_endpoint := "dataset/v" // मॉडल endpoint सेट करें

    // डिस्क पर फ़ाइल खोलें।
    f, _ := os.Open("YOUR_IMAGE.jpg")

    // संपूर्ण JPG को बाइट स्लाइस में पढ़ें।
    reader := bufio.NewReader(f)
    content, _ := ioutil.ReadAll(reader)

    // base64 के रूप में एन्कोड करें।
    data := base64.StdEncoding.EncodeToString(content)
	uploadURL := "https://serverless.roboflow.com/" + model_endpoint + "?name=YOUR_IMAGE.jpg"

	req, _ := http.NewRequest("POST", uploadURL, strings.NewReader(data))
    req.Header.Set("Authorization", "Bearer "+api_key)
    req.Header.Set("Accept", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

   	bytes, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(bytes))

}
```

**URL के माध्यम से कहीं और होस्ट की गई इमेज पर इन्फ़र करना**

```go
package main

import (
    "fmt"
	"net/http"
	"net/url"
  "io/ioutil"
)

func main() {
	api_key := ""  // आपका API Key
	model_endpoint := "dataset/v" // मॉडल endpoint सेट करें
	img_url := "https://i.ibb.co/jzr27x0/YOUR-IMAGE.jpg"


	uploadURL := "https://serverless.roboflow.com/" + model_endpoint + "?image=" + url.QueryEscape(img_url)

	req, _ := http.NewRequest("POST", uploadURL, nil)
    req.Header.Set("Authorization", "Bearer "+api_key)
    req.Header.Set("Accept", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

   	bytes, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(bytes))


}
```

{% endtab %}

{% tab title=".NET" %}
**एक स्थानीय इमेज पर इन्फ़र करना**

```csharp
using System;
using System.IO;
using System.Net;
using System.Text;

namespace InferenceLocal
{
    class InferenceLocal
    {

        static void Main(string[] args)
        {
            byte[] imageArray = System.IO.File.ReadAllBytes(@"YOUR_IMAGE.jpg");
            string encoded = Convert.ToBase64String(imageArray);
            byte[] data = Encoding.ASCII.GetBytes(encoded);
            string API_KEY = ""; // आपका API कुंजी
            string MODEL_ENDPOINT = "dataset/v"; // मॉडल एंडपॉइंट सेट करें

            // URL बनाएं
            string uploadURL =
                    "https://serverless.roboflow.com/" + MODEL_ENDPOINT + "?name=YOUR_IMAGE.jpg";

            // सेवा अनुरोध कॉन्फ़िगरेशन
            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

            // अनुरोध कॉन्फ़िगर करें
            WebRequest request = WebRequest.Create(uploadURL);
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.Headers.Add("Authorization", "Bearer " + API_KEY);
            request.ContentLength = data.Length;

            // डेटा लिखें
            using (Stream stream = request.GetRequestStream())
            {
                stream.Write(data, 0, data.Length);
            }

            // प्रतिक्रिया प्राप्त करें
            string responseContent = null;
            using (WebResponse response = request.GetResponse())
            {
                using (Stream stream = response.GetResponseStream())
                {
                    using (StreamReader sr99 = new StreamReader(stream))
                    {
                        responseContent = sr99.ReadToEnd();
                    }
                }
            }

            Console.WriteLine(responseContent);

        }
    }
}
```

**URL के माध्यम से कहीं और होस्ट की गई इमेज पर इन्फ़र करना**

```csharp
using System;
using System.IO;
using System.Net;
using System.Web;

namespace InferenceHosted
{
    class InferenceHosted
    {
        static void Main(string[] args)
        {
            string API_KEY = ""; // आपका API कुंजी
            string imageURL = "https://i.ibb.co/jzr27x0/YOUR-IMAGE.jpg";
            string MODEL_ENDPOINT = "dataset/v"; // मॉडल एंडपॉइंट सेट करें

            // URL बनाएं
            string uploadURL =
                    "https://serverless.roboflow.com/" + MODEL_ENDPOINT
                    + "?image=" + HttpUtility.UrlEncode(imageURL);

            // सेवा बिंदु कॉन्फ़िगरेशन
            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

            // HTTP अनुरोध कॉन्फ़िगर करें
            WebRequest request = WebRequest.Create(uploadURL);
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.Headers.Add("Authorization", "Bearer " + API_KEY);
            request.ContentLength = 0;

            // प्रतिक्रिया प्राप्त करें
            string responseContent = null;
            using (WebResponse response = request.GetResponse())
            {
                using (Stream stream = response.GetResponseStream())
                {
                    using (StreamReader sr99 = new StreamReader(stream))
                    {
                        responseContent = sr99.ReadToEnd();
                    }
                }
            }

            Console.WriteLine(responseContent);

        }
    }
}
```

{% endtab %}

{% tab title="एलिक्सिर" %}
हम उपयोगकर्ताओं के अनुरोधों के अनुसार कोड स्निपेट जोड़ रहे हैं। यदि आप इन्फ़रेंस API को अपने Elixir ऐप में एकीकृत करना चाहते हैं, तो कृपया [अपवोट दर्ज करने के लिए यहाँ क्लिक करें](https://app.roboflow.com/request/snippet.upload-elixir).
{% endtab %}
{% endtabs %}

### प्रतिक्रिया ऑब्जेक्ट प्रारूप

होस्टेड API इन्फ़रेंस रूट एक `JSON` ऑब्जेक्ट लौटाता है जिसमें भविष्यवाणियों की एक ऐरे होती है। प्रत्येक भविष्यवाणी में निम्नलिखित गुण होते हैं:

* `x` = पहचाने गए ऑब्जेक्ट का क्षैतिज केंद्र बिंदु
* `y` = पहचाने गए ऑब्जेक्ट का ऊर्ध्वाधर केंद्र बिंदु
* `width` = बाउंडिंग बॉक्स की चौड़ाई
* `height` = बाउंडिंग बॉक्स की ऊँचाई
* `class` = पहचाने गए ऑब्जेक्ट का वर्ग लेबल
* `confidence` = सही लेबल और स्थिति निर्देशांक के साथ पहचाना गया ऑब्जेक्ट होने की मॉडल की विश्वसनीयता
* `keypoints` = कीपॉइंट भविष्यवाणियों की एक ऐरे
  * `x` = कीपॉइंट का क्षैतिज केंद्र (इमेज के ऊपरी-बाएँ कोने के सापेक्ष)
  * `y` = कीपॉइंट का ऊर्ध्वाधर केंद्र (इमेज के ऊपरी-बाएँ कोने के सापेक्ष)
  * `class_name` = कीपॉइंट का नाम
  * `class_id` = कीपॉइंट की आईडी, स्केलेटन से मैप होती है `vertices` वर्शन रिकॉर्ड में, वर्टेक्स रंग और स्केलेटन किनारों को मैप करने के लिए, [अपनी प्रोजेक्ट संस्करण देखें](https://docs.roboflow.com/datasets/versions/dataset-versions#view-a-version)
  * `confidence` = यह विश्वसनीयता कि कीपॉइंट सही स्थान पर है, और दिखाई दे रहा है (ढका हुआ या हटाया नहीं गया)

यहाँ REST API से एक उदाहरण प्रतिक्रिया ऑब्जेक्ट है:

```json
{
    "predictions": [
        {
            "x": 189.5,
            "y": 100,
            "width": 163,
            "height": 186,
            "class": "helmet",
            "confidence": 0.544,
            "keypoints": [
                {
                    "x": 189, 
                    "y": 20,
                    "class_name": "top",
                    "class_id": 0,
                    "confidence": 0.91
                },
                {
                    "x": 188, 
                    "y": 180,
                    "class_name": "bottom",
                    "class_id": 1,
                    "confidence": 0.93
                }
            ]
        }
    ],
    "image": {
        "width": 2048,
        "height": 1371
    }
}
```

यह `image` विशेषता में इन्फ़रेंस के लिए भेजी गई इमेज की ऊँचाई और चौड़ाई शामिल होती है। बाउंडिंग बॉक्स गणनाओं के लिए आपको इन मानों का उपयोग करना पड़ सकता है।

### इन्फ़रेंस API पैरामीटर

## इन्फ़रेंस API का उपयोग करना

<mark style="color:हरा;">`POST`</mark> `https://serverless.roboflow.com/:datasetSlug/:versionNumber`

आप सीधे अपने मॉडल एंडपॉइंट पर base64-एन्कोड की गई इमेज POST कर सकते हैं। या यदि आपकी इमेज पहले से कहीं और होस्टेड है, तो आप क्वेरी स्ट्रिंग में `image` पैरामीटर के रूप में एक URL पास कर सकते हैं।

#### पाथ पैरामीटर

| नाम         | प्रकार | विवरण                                                                                                                                                                                                                           |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| datasetSlug | string | डेटासेट नाम का URL-सुरक्षित संस्करण। इसे आप वेब UI में मुख्य प्रोजेक्ट व्यू के URL को देखकर या मॉडल को प्रशिक्षित करने के बाद अपने डेटासेट संस्करण के ट्रेन परिणाम अनुभाग में "Get curl command" बटन पर क्लिक करके पा सकते हैं। |
| version     | number | आपके डेटासेट के संस्करण की पहचान करने वाला संस्करण नंबर                                                                                                                                                                         |

#### क्वेरी पैरामीटर

| नाम        | प्रकार  | विवरण                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| image      | string  | <p>जोड़ने के लिए इमेज का URL। यदि आपकी इमेज कहीं और होस्ट की गई है, तो इसका उपयोग करें। (जब आप अनुरोध बॉडी में base64-एन्कोड की गई इमेज POST नहीं करते हैं, तब आवश्यक है.)<br><br><strong>नोट:</strong> इसे URL-encode करना न भूलें।</p>                                                                                                                                                                                                                                  |
| classes    | string  | <p>भविष्यवाणियों को केवल कुछ विशेष वर्गों तक सीमित करें। कॉमा से अलग की गई स्ट्रिंग के रूप में प्रदान करें।<br><br><strong>उदाहरण:</strong> dog,cat<br><br><strong>डिफ़ॉल्ट:</strong> उपस्थित नहीं (सभी वर्ग दिखाएँ)</p>                                                                                                                                                                                                                                                  |
| overlap    | number  | <p>एक ही वर्ग की बाउंडिंग बॉक्स भविष्यवाणियों को एक ही बॉक्स में मिलाने से पहले अधिकतम कितना प्रतिशत (0-100 के पैमाने पर) ओवरलैप करने की अनुमति है।<br><br><strong>डिफ़ॉल्ट:</strong> 30</p>                                                                                                                                                                                                                                                                              |
| confidence | number  | <p>0-100 के पैमाने पर लौटाई गई भविष्यवाणियों के लिए एक थ्रेशहोल्ड। कम संख्या अधिक भविष्यवाणियाँ लौटाएगी। अधिक संख्या कम, अधिक-निश्चित भविष्यवाणियाँ लौटाएगी।<br><br><strong>डिफ़ॉल्ट:</strong> 40</p>                                                                                                                                                                                                                                                                     |
| stroke     | number  | <p>भविष्यवाणियों के चारों ओर प्रदर्शित बाउंडिंग बॉक्स की चौड़ाई (पिक्सेल में) (केवल तब प्रभावी होती है जब <code>format</code> है <code>image</code>).<br><br><strong>डिफ़ॉल्ट:</strong> 1</p>                                                                                                                                                                                                                                                                             |
| labels     | boolean | <p>क्या भविष्यवाणियों पर टेक्स्ट लेबल दिखाने हैं या नहीं (केवल तब प्रभावी होती है जब <code>format</code> है <code>image</code>).<br><br><strong>डिफ़ॉल्ट:</strong> false</p>                                                                                                                                                                                                                                                                                              |
| format     | string  | <p><strong>json</strong> - JSON भविष्यवाणियों की एक ऐरे लौटाता है। (प्रतिक्रिया प्रारूप टैब देखें).<br><strong>image</strong> - एक इमेज लौटाता है जिसमें एनोटेटेड भविष्यवाणियाँ एक बाइनरी ब्लॉब के रूप में होती हैं, साथ में एक <code>Content-Type</code> का <code>image/jpeg</code>. <strong>image\_and\_json</strong> - JSON भविष्यवाणियों की एक ऐरे लौटाता है, जिसमें base64 में एक विज़ुअलाइज़ेशन फ़ील्ड भी शामिल होता है।<br><br><strong>डिफ़ॉल्ट</strong>: json</p> |
| api\_key   | string  | आपकी API कुंजी (आपके workspace API settings पेज के माध्यम से प्राप्त)                                                                                                                                                                                                                                                                                                                                                                                                     |

#### अनुरोध बॉडी

| नाम | प्रकार | विवरण                                                                                          |
| --- | ------ | ---------------------------------------------------------------------------------------------- |
|     | string | एक base64-एन्कोड की गई इमेज। (जब आप क्वेरी पैरामीटर में इमेज URL नहीं देते हैं, तब आवश्यक है). |

{% tabs %}
{% tab title="200 JSON प्रारूप की भविष्यवाणियाँ। (x,y) बॉक्स" %}

```
{
    "predictions": [{
        "x": 234.0,
        "y": 363.5,
        "width": 160,
        "height": 197,
        "class": "hand",
        "confidence": 0.943
    }, {
        "x": 504.5,
        "y": 363.0,
        "width": 215,
        "height": 172,
        "class": "hand",
        "confidence": 0.917
    }, {
        "x": 1112.5,
        "y": 691.0,
        "width": 139,
        "height": 52,
        "class": "hand",
        "confidence": 0.87
    }, {
        "x": 78.5,
        "y": 700.0,
        "width": 139,
        "height": 34,
        "class": "hand",
        "confidence": 0.404
    }]
}
```

{% endtab %}

{% tab title="403 यदि आपका api\_key मॉडल तक पहुँचने के लिए अधिकृत नहीं है।" %}

```
{
    "Message": "User इस संसाधन तक पहुँचने के लिए अधिकृत नहीं है"
}
```

{% endtab %}
{% endtabs %}
