एक Model API Endpoint का उपयोग करें
Roboflow के cloud GPUs पर बिना hardware सेटअप किए पाँच मिनट में एक model चलाएँ।
उनका नाम बताकर objects ढूँढें
3
मॉडल चलाएँ
import os
import base64
import cv2
import requests
import supervision as sv
import numpy as np
content = requests.get("https://media.roboflow.com/quickstart/traffic.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)
image_b64 = base64.b64encode(content).decode("utf-8")
h, w = image.shape[:2]
response = requests.post(
"https://serverless.roboflow.com/sam3/concept_segment",
params={"api_key": os.environ["ROBOFLOW_API_KEY"]},
json={
"image": {"type": "base64", "value": image_b64},
"prompts": [
{"type": "text", "text": "taxi"},
{"type": "text", "text": "blue bus"},
{"type": "text", "text": "bush"},
],
},
)
detections = sv.Detections.from_sam3(response.json(), (w, h))
annotated = sv.MaskAnnotator().annotate(image.copy(), detections)
cv2.imwrite("sam3.jpg", annotated)3
मॉडल चलाएँ
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)
h, w = image.shape[:2]
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
data = client.sam3_concept_segment(
image,
prompts=[
{"type": "text", "text": "taxi"},
{"type": "text", "text": "blue bus"},
{"type": "text", "text": "bush"},
],
)
detections = sv.Detections.from_sam3(data, (w, h))
annotated = sv.MaskAnnotator().annotate(image.copy(), detections)
annotated = sv.BoxAnnotator().annotate(annotated, detections)
cv2.imwrite("sam3.jpg", annotated)
ready-made model से everyday objects detect करें

अपना खुद का या कोई और model चलाएँ
अगला कदम कहाँ जाएँ
अंतिम अपडेट
क्या यह उपयोगी था?