YOLOv7
Use YOLOv7 instance segmentation through our Serverless Cloud API
Code sample
3
Run the model
import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient
image = sv.load_image_from_url("https://media.roboflow.com/docs/concrete-crack.jpg")
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
results = client.infer(image, model_id="concrete-pugqq/3")
detections = sv.Detections.from_inference(results)
annotated = sv.MaskAnnotator().annotate(image.copy(), detections)
cv2.imwrite("annotated.png", annotated)
Last updated
Was this helpful?