REST API के साथ उपयोग करें
Serverless Hosted API V2 के सभी मॉडल और वर्कफ़्लो के लिए एक ही एंडपॉइंट है:
https://serverless.roboflow.com
ऑब्जेक्ट डिटेक्शन, कीपॉइंट डिटेक्शन
https://serverless.roboflow.com
https://detect.roboflow.com
इंस्टेंस सेगमेंटेशन
https://serverless.roboflow.com
https://outline.roboflow.com
वर्गीकरण
https://serverless.roboflow.com
https://classify.roboflow.com
सेमांटिक सेगमेंटेशन
वर्तमान में समर्थित नहीं है
https://segment.roboflow.com
फाउंडेशन मॉडल (जैसे CLIP, OCR, YOLO-World)
https://serverless.roboflow.com
https://infer.roboflow.com
HTTP के साथ अनुरोध करें
Checks Roboflow API for workflow definition, once acquired - parses and executes injecting runtime parameters from request body
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
List of field that shall be excluded from the response (among those defined in workflow specification)
Flag to request Workflow run profiling. Enables Workflow profiler only when server settings allow profiling traces to be exported to clients. Only applies for Workflows definitions saved on Roboflow platform.
false
Optional identifier of workflow
Controls usage of cache for workflow definitions. Set this to False when you frequently modify definition saved in Roboflow app and want to fetch the newest version for the request.
true
POST /{workspace_name}/workflows/{workflow_id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 156
{
"api_key": "text",
"inputs": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"excluded_fields": [
"text"
],
"enable_profiling": false,
"workflow_id": "text",
"use_cache": true
}
{
"outputs": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"profiler_trace": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
]
}
Python SDK के साथ अनुरोध करें
यदि आप Python में काम कर रहे हैं, तो Serverless API के साथ इंटरैक्ट करने का सबसे सुविधाजनक तरीका Inference Python SDK का उपयोग करना है।
SDK का उपयोग करने के लिए, पहले इसे इंस्टॉल करें:
pip install inference-sdk
Serverless Hosted API V2 पर अनुरोध करने के लिए निम्नलिखित कोड का उपयोग करें:
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="model-id/1")
Last updated
Was this helpful?