support 1.5 image demo

This commit is contained in:
rentainhe
2024-08-01 21:30:56 +08:00
parent f5b99eea3d
commit d27829ff17
4 changed files with 157 additions and 10 deletions

View File

@@ -103,8 +103,8 @@ img = cv2.imread(img_path)
detections = sv.Detections(
xyxy=input_boxes, # (n, 4)
mask=masks, # (n, h, w)
)
box_annotator = sv.BoxAnnotator()
annotated_frame = box_annotator.annotate(scene=img.copy(), detections=detections, labels=labels)
cv2.imwrite("groundingdino_annotated_image.jpg", annotated_frame)