upgrade supervision to 0.22.0 and refine custom API usage
This commit is contained in:
@@ -154,7 +154,9 @@ for frame_idx, segments in video_segments.items():
|
||||
class_id=np.array(object_ids, dtype=np.int32),
|
||||
)
|
||||
box_annotator = sv.BoxAnnotator()
|
||||
annotated_frame = box_annotator.annotate(scene=img.copy(), detections=detections, labels=[ID_TO_OBJECTS[i] for i in object_ids])
|
||||
annotated_frame = box_annotator.annotate(scene=img.copy(), detections=detections)
|
||||
label_annotator = sv.LabelAnnotator()
|
||||
annotated_frame = label_annotator.annotate(annotated_frame, detections=detections, labels=[ID_TO_OBJECTS[i] for i in object_ids])
|
||||
mask_annotator = sv.MaskAnnotator()
|
||||
annotated_frame = mask_annotator.annotate(scene=annotated_frame, detections=detections)
|
||||
cv2.imwrite(os.path.join(save_dir, f"annotated_frame_{frame_idx:05d}.jpg"), annotated_frame)
|
||||
|
Reference in New Issue
Block a user