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

RF-DETR

हमारे Serverless Hosted API के माध्यम से Roboflow के RF-DETR model का उपयोग करें

RF-DETR Object Detection

RF-DETR, Roboflow का transformer-आधारित real-time detection model है। COCO-pretrained object detection checkpoints के विरुद्ध inference चलाएँ Serverless Hosted API, या self-host using Roboflow Inference.

कोड नमूना

नीचे दिए गए चरण RF-DETR को चलाते हैं Serverless Hosted API और परिणामों को visualize करते हैं supervision.

1

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

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

export ROBOFLOW_API_KEY="your-key-here"
2

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

ये दो packages model को call करते हैं और इसके परिणामों को draw करते हैं:

pip install inference-sdk supervision
3

मॉडल चलाएँ

चलाएँ rfdetr-small एक sample image पर और boxes तथा labels annotate करें:

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

image_url = "https://media.roboflow.com/quickstart/traffic.jpg"
content = requests.get(image_url).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"],
)
result = client.infer(image, model_id="rfdetr-small")

detections = sv.Detections.from_inference(result)

annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections)

cv2.imwrite("traffic-annotated.png", annotated)

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

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

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

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

Pretrained models और benchmarks

इनमें से किसी भी alias को बतौर पास करें model_id जब inference चलाया जा रहा हो। SDK प्रत्येक alias को underlying Roboflow project version से resolve करता है।

उपनाम
इनपुट आकार
mAP50-95
ONNX latency (ms)*
TensorRT FP16 (ms)*

rfdetr-nano

384x384

48.4

9.7

6.2

rfdetr-small

512x512

53.0

12.9

8.3

rfdetr-medium

576x576

54.7

16.3

9.5

rfdetr-large

704x704

56.5

25.6

11.6

rfdetr-xlarge

700x700

58.6

41.6

14.9

rfdetr-2xlarge

880x880

60.1

53.4

21.7

RF-DETR Instance Segmentation

RF-DETR instance segmentation checkpoints भी प्रदान करता है, जो boxes के साथ-साथ masks की भी भविष्यवाणी करते हैं। उन्हें के माध्यम से चलाएँ Serverless Hosted API, या self-host using Roboflow Inference.

कोड नमूना

अपनी API key सेट करें और ऊपर दिखाए अनुसार dependencies install करें, फिर एक segmentation checkpoint चलाएँ और उसके masks draw करें:

Pretrained models और benchmarks

इनमें से किसी भी alias को बतौर पास करें model_id जब inference चलाया जा रहा हो। SDK प्रत्येक alias को underlying Roboflow project version से resolve करता है। Figures COCO पर mask mAP हैं val.

उपनाम
इनपुट आकार
Mask mAP50-95
ONNX latency (ms)*
TensorRT FP16 (ms)*

rfdetr-seg-nano

312x312

40.3

15.8

10.5

rfdetr-seg-small

384x384

43.1

19.3

11.9

rfdetr-seg-medium

432x432

45.3

23.9

14.1

rfdetr-seg-large

504x504

47.1

30.1

15.4

rfdetr-seg-xlarge

624x624

48.8

51.2

19.1

rfdetr-seg-2xlarge

768x768

49.9

89.6

25.6


* Latency मापी जाती है Roboflow Inference 1x NVIDIA L4 पर, batch size 1, 1,000 inferences का औसत (100 warmup)। डिफ़ॉल्ट inference-gpu install CUDA execution provider पर ONNX चलाता है; inference-models[trt10] extra जोड़ने से prebuilt TensorRT FP16 engine अपने-आप चयन हो जाता है। FP16, COCO val2017. Accuracy प्रकाशित COCO val spec है (देखें RF-DETR announcement)).

अंतिम अपडेट

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