For the complete documentation index, see llms.txt. This page is also available as Markdown.

Roboflow Instant

Serverless Hosted API के माध्यम से एक Roboflow Instant few-shot object detection model चलाएँ।

Roboflow Instant एक few-shot object detection model है जो labeled images के छोटे सेट से कुछ ही मिनटों में train होता है। इसका उद्देश्य तेज़ Proof of Concept work के लिए है और यह केवल Object Detection projects को support करता है। इसे train करना कैसे है, यह सीखें Roboflow Instant.

एक बार train हो जाने पर, एक Instant model उपलब्ध होता है Serverless Hosted API उसी endpoint pattern का उपयोग करके, जैसे किसी अन्य Roboflow model के लिए किया जाता है।

इसे कैसे उपयोग करें

आप अपने Roboflow Instant model को उसके per-model {workspace}/{model-slug} ID (देखें Versions, Trainings, and Models), उसी तरह जैसे आप Roboflow 3.0 model को call करते हैं।

Instant models के लिए confidence thresholds संवेदनशील हो सकते हैं। Optimal values आमतौर पर 0.85 से 0.99 के बीच होती हैं, जो आपके training set के आकार पर निर्भर करता है।

कोड नमूना

1

अपनी API Key प्राप्त करें

एक Roboflow खाता बनाएं, अपनी key यहाँ पर ढूँढें Roboflow API settings page और इसे अपने shell में उपलब्ध कराएँ:

export ROBOFLOW_API_KEY="your-key-here"
2

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

इंस्टॉल करें Inference SDK और supervision:

pip install inference-sdk supervision
3

मॉडल चलाएँ

यह उदाहरण सार्वजनिक rf-bolts Roboflow Instant model (screw, flat-washer, hex-nut), छोटे labeled set से few-shot तरीके से train किया गया। अपना खुद का {workspace}/{model-slug} अपने train किए गए Instant model के लिए।

import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/docs/bolts.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)
results = client.infer(image, model_id="erik-pe6au/bolts-uzqzc-instant-1")

detections = sv.Detections.from_inference(results)

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

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

सेट करें api_url को अपने deployment target से मिलाएँ:

  • https://serverless.roboflow.com Serverless Hosted API के लिए।

  • http://localhost:9001 एक local Inference server.

  • आपका Dedicated Deployment एक private endpoint के लिए URL.

अधिक deployment options और self-hosting के लिए, देखें Inference documentation.

अंतिम अपडेट

क्या यह उपयोगी था?