RF-DETR
Use Roboflow's RF-DETR model through our Serverless Hosted API
Code samples
Object detection
pip install inference-sdk supervisionimport os
import urllib.request
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient
image_url = "https://storage.googleapis.com/com-roboflow-marketing/notebooks/examples/cars-highway.png"
image_path = "cars-highway.png"
urllib.request.urlretrieve(image_url, image_path)
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.getenv("API_KEY"),
)
result = client.infer(image_path, model_id="rfdetr-base")
image = cv2.imread(image_path)
detections = sv.Detections.from_inference(result)
box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()
annotated = box_annotator.annotate(scene=image.copy(), detections=detections)
annotated = label_annotator.annotate(scene=annotated, detections=detections)
cv2.imwrite("cars-highway-annotated.png", annotated)
Instance segmentation

Default COCO-trained models
Alias
Task
Input Size
Last updated
Was this helpful?