Roboflow 3.0
हमारे Serverless Hosted API के माध्यम से Roboflow 3.0 model family का उपयोग करें
Roboflow 3.0 Object Detection
कोड नमूना
1
export ROBOFLOW_API_KEY="your-key-here"2
pip install inference-sdk supervision3
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/quickstart/traffic.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"],
)
result = client.infer(image, model_id="coco/3")
detections = sv.Detections.from_inference(result)
annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections)
cv2.imwrite("output.png", annotated)
Roboflow 3.0 Instance Segmentation
कोड नमूना
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/quickstart/traffic.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"],
)
# No pretrained aliases: अपना model train करें और "your-project/1" को अपने model ID से बदलें।
result = client.infer(image, model_id="your-project/1")
detections = sv.Detections.from_inference(result)
annotated = sv.MaskAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections)
cv2.imwrite("output.png", annotated)Roboflow 3.0 Keypoint Detection
कोड नमूना

Roboflow 3.0 Classification
कोड नमूना
अंतिम अपडेट
क्या यह उपयोगी था?