# 인스턴스 세분화

{% tabs %}
{% tab title="cURL" %}
**Linux 또는 MacOS**

로컬 파일의 JSON 예측을 가져오기 `YOUR_IMAGE.jpg`:

```bash
base64 YOUR_IMAGE.jpg | curl -d @- \
"https://serverless.roboflow.com/your-model/42?api_key=YOUR_KEY"
```

웹의 다른 곳에 호스팅된 이미지를 그 URL을 통해 추론하기(잊지 말고 [URL 인코딩하세요](https://www.urlencoder.org/)):

```bash
curl -X POST "https://serverless.roboflow.com/your-model/42?\
api_key=YOUR_KEY&\
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). 가장 쉬운 방법은 다음을 사용하는 것입니다 [Windows용 git 설치 프로그램](https://git-scm.com/downloads) 여기에는 다음도 포함됩니다 `curl` 및 `base64` 설치 중 "Use Git and optional Unix tools from the Command Prompt"를 선택하면 명령줄 도구를 사용할 수 있습니다.

그런 다음 위와 동일한 명령을 사용할 수 있습니다.
{% endtab %}

{% tab title="Python" %}
**로컬 및 호스팅 이미지에서 추론**

의존성을 설치하려면 `pip install inference-sdk`.

```
from inference_sdk import InferenceHTTPClient

CLIENT = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key="API_KEY"
)

result = CLIENT.infer(your_image.jpg, model_id="football-pitch-segmentation/1")

```

{% endtab %}

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

이 예제에서는 [axios](https://github.com/axios/axios) 를 사용하여 POST 요청을 수행하므로 먼저 다음을 실행하세요 `npm install axios` 의존성을 설치하기 위해.

**로컬 이미지에서 추론**

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

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

axios({
    method: "POST",
    url: "https://serverless.roboflow.com/your-model/42",
    params: {
        api_key: "YOUR_KEY"
    },
    data: image,
    headers: {
        "Content-Type": "application/x-www-form-urlencoded"
    }
})
.then(function(response) {
    console.log(response.data);
})
.catch(function(error) {
    console.log(error.message);
});
```

**URL을 통해 웹의 다른 곳에 호스팅된 이미지에서 추론**

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

axios({
    method: "POST",
    url: "https://serverless.roboflow.com/your-model/42",
    params: {
        api_key: "YOUR_KEY",
        image: "https://i.imgur.com/PEEvqPN.png"
    }
})
.then(function(response) {
    console.log(response.data);
})
.catch(function(error) {
    console.log(error.message);
});
```

**Web**

roboflow\.js를 통해 디바이스에서 실시간 추론을 사용할 수 있습니다 `roboflow.js`; 여기를 참조하세요 [문서는 여기에서](/roboflow/roboflow-ko/deploy/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, Model, 및 Model Version으로 Inference Server 요청 초기화
var request = URLRequest(url: URL(string: "https://serverless.roboflow.com/your-model/your-model-version?api_key=YOUR_APIKEY&name=YOUR_IMAGE.jpg")!,timeoutInterval: Double.infinity)
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData

// POST 요청 실행
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()
```

**Objective C**

[Objective-C 스니펫을 요청하려면 여기를 클릭하세요.](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)

    // Base 64 인코딩
    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 = "" // Your API Key
    val MODEL_ENDPOINT = "dataset/v" // 모델 엔드포인트 설정 (Dataset URL에서 확인)

    // URL 구성
    val uploadURL ="https://serverless.roboflow.com/" + MODEL_ENDPOINT + "?api_key=" + API_KEY + "&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("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 = "" // Your API Key
    val MODEL_ENDPOINT = "dataset/v" // 모델 엔드포인트 설정

    // 업로드 URL
    val uploadURL = "https://serverless.roboflow.com/" + MODEL_ENDPOINT + "?api_key=" + API_KEY + "&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("Content-Language", "en-US")
        connection.useCaches = false
        connection.doOutput = true

        // 요청 전송
        val wr = DataOutputStream(connection.outputStream)
        wr.writeBytes(uploadURL)
        wr.close()

        // 응답 가져오기
        val stream = URL(uploadURL).openStream()
        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);

        // Base 64 인코딩
        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 = ""; // Your API Key
        String MODEL_ENDPOINT = "dataset/v"; // 모델 엔드포인트

        // URL 구성
        String uploadURL = "https://serverless.roboflow.com/" + MODEL_ENDPOINT + "?api_key=" + API_KEY
                + "&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("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 = ""; // Your API Key
        String MODEL_ENDPOINT = "dataset/v"; // 모델 엔드포인트

        // 업로드 URL
        String uploadURL = "https://serverless.roboflow.com/" + MODEL_ENDPOINT + "?api_key=" + API_KEY + "&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("Content-Language", "en-US");
            connection.setUseCaches(false);
            connection.setDoOutput(true);

            // 요청 전송
            DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
            wr.writeBytes(uploadURL);
            wr.close();

            // 응답 가져오기
            InputStream stream = new URL(uploadURL).openStream();
            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" # 모델 엔드포인트 설정
api_key = "" # 여기 API KEY

params = "?api_key=" + api_key
+ "&name=YOUR_IMAGE.jpg"

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

  puts response

 
```

**URL을 통해 웹의 다른 곳에 호스팅된 이미지에서 추론**

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

model_endpoint = "dataset/v" # 모델 엔드포인트 설정
api_key = "" # 여기 API KEY
img_url = "https://i.imgur.com/PEEvqPN.png" # URL 구성

img_url = CGI::escape(img_url)

params =  "?api_key=" + api_key + "&image=" + img_url

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

puts response
```

{% endtab %}

{% tab title="PHP" %}
**로컬 이미지에서 추론**

```php
<?php

// 이미지를 Base 64로 인코딩
$data = base64_encode(file_get_contents("YOUR_IMAGE.jpg"));

$api_key = ""; // API 키 설정
$model_endpoint = "dataset/v"; // 모델 엔드포인트 설정 (Dataset URL에서 확인)

// Http 요청용 URL
$url = "https://serverless.roboflow.com/" . $model_endpoint
. "?api_key=" . $api_key
. "&name=YOUR_IMAGE.jpg";

// Http 요청 설정 + 전송
$options = array(
  'http' => array (
    'header' => "Content-type: application/x-www-form-urlencoded\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 키 설정
$model_endpoint = "dataset/v"; // 모델 엔드포인트 설정 (Dataset URL에서 확인)
$img_url = "https://i.imgur.com/PEEvqPN.png";

// Http 요청용 URL
$url =  "https://serverless.roboflow.com/" . $model_endpoint
. "?api_key=" . $api_key
. "&image=" . urlencode($img_url);

// Http 요청 설정 + 전송
$options = array(
  'http' => array (
    'header' => "Content-type: application/x-www-form-urlencoded\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 := ""  // Your API Key
	model_endpoint := "dataset/v" // 모델 엔드포인트 설정

    // 디스크에서 파일 열기.
    f, _ := os.Open("YOUR_IMAGE.jpg")

    // 전체 JPG를 byte slice로 읽기.
    reader := bufio.NewReader(f)
    content, _ := ioutil.ReadAll(reader)

    // base64로 인코딩.
    data := base64.StdEncoding.EncodeToString(content)
	uploadURL := "https://serverless.roboflow.com/" + model_endpoint + "?api_key=" + api_key + "&name=YOUR_IMAGE.jpg"

	req, _ := http.NewRequest("POST", uploadURL, strings.NewReader(data))
    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 := ""  // Your API Key
	model_endpoint := "dataset/v" // 모델 엔드포인트 설정
	img_url := "https://i.ibb.co/jzr27x0/YOUR-IMAGE.jpg"


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

	req, _ := http.NewRequest("POST", uploadURL, nil)
    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 = ""; // Your API Key
            string MODEL_ENDPOINT = "dataset/v"; // 모델 엔드포인트 설정

            // URL 구성
            string uploadURL =
                    "https://serverless.roboflow.com/" + MODEL_ENDPOINT + "?api_key=" + API_KEY
                + "&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.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 = ""; // Your API Key
            string imageURL = "https://i.ibb.co/jzr27x0/YOUR-IMAGE.jpg";
            string MODEL_ENDPOINT = "dataset/v"; // 모델 엔드포인트 설정

            // URL 구성
            string uploadURL =
                    "https://serverless.roboflow.com/" + MODEL_ENDPOINT
                    + "?api_key=" + API_KEY
                    + "&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.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="Elixer" %}
사용자 요청에 따라 코드 스니펫을 추가하고 있습니다. Elixir 앱에 inference API를 통합하고 싶다면, [업보트를 기록하려면 여기를 클릭하세요](https://app.roboflow.com/request/snippet.upload-elixir).
{% endtab %}
{% endtabs %}

## 응답 객체 형식

호스팅된 API inference 경로는 다음을 반환합니다 `JSON` 예측 배열을 포함한 객체입니다. 각 예측에는 다음 속성이 있습니다:

* `x` = 감지된 객체의 가로 중앙점
* `y` = 감지된 객체의 세로 중앙점
* `width` = 바운딩 박스의 너비
* `height` = 바운딩 박스의 높이
* `class` = 감지된 객체의 클래스 레이블
* `confidence` = 감지된 객체의 레이블과 위치 좌표가 올바를 확률에 대한 모델의 신뢰도
* `points` = 객체의 다각형 윤곽을 구성하는 점들의 목록 - 목록의 각 항목은 다음 키를 가진 객체입니다 `x` 및 `y` 각 점의 가로 및 세로 좌표에 대해 각각

```json
// 예시 JSON 객체
{
  "predictions": [
    {
      "x": 179.2,
      "y": 247,
      "width": 231,
      "height": 147,
      "class": "A",
      "confidence": 0.98,
      "points": [
        {
          "x": 134,
          "y": 314
        },
        {
          "x": 116,
          "y": 313
        },
        {
          "x": 103,
          "y": 310.1
        },
        {
          "x": 72.7,
          "y": 282
        },
        {
          "x": 66.8,
          "y": 273
        },
      ]
    }
  ]
}
```

## API Reference

## Inference API 사용

<mark style="color:초록색;">`POST`</mark> `https://serverless.roboflow.com/:datasetSlug/:versionNumber`

base64로 인코딩된 이미지를 모델 엔드포인트로 직접 POST할 수 있습니다. 또는 `image` 를 쿼리 문자열의 매개변수로 전달할 수 있습니다. 이미지가 이미 다른 곳에 호스팅되어 있는 경우입니다.

#### 경로 매개변수

| 이름          | 유형     | 설명                                                                                                                                         |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| datasetSlug | string | dataset 이름의 URL 안전 버전입니다. 웹 UI에서 메인 프로젝트 뷰의 URL을 보거나, 모델을 학습한 후 dataset version의 train results 섹션에서 "Get curl command" 버튼을 클릭하면 찾을 수 있습니다. |
| version     | number | dataset의 버전을 식별하는 버전 번호                                                                                                                    |

#### 쿼리 매개변수

| 이름         | 유형     | 설명                                                                                                                                                     |
| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| image      | string | <p>추가할 이미지의 URL입니다. 이미지가 다른 곳에 호스팅되어 있는 경우 사용하세요. (요청 본문에 base64로 인코딩된 이미지를 POST하지 않는 경우 필수입니다.)<br><br><strong>참고:</strong> URL 인코딩을 잊지 마세요.</p>      |
| overlap    | number | <p>같은 클래스의 bounding box 예측이 하나의 박스로 합쳐지기 전에 서로 겹칠 수 있는 최대 비율(0-100 척도)입니다.<br><br><strong>기본값:</strong> 30<br><br>이 매개변수는 RF-DETR 모델에 영향을 주지 않습니다.</p> |
| confidence | number | <p>반환된 예측에 대한 임계값으로, 0-100 척도입니다. 숫자가 낮을수록 더 많은 예측이 반환됩니다. 숫자가 높을수록 더 적은 고신뢰도 예측이 반환됩니다.<br><br><strong>기본값:</strong> 40</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 is not authorized to access this resource"
}
```

{% endtab %}
{% endtabs %}


---

# 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-ko/deploy/serverless/instance-segmentation.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.
