From 4b35c7a0c89916a67f79d41af279b49d64fde07d Mon Sep 17 00:00:00 2001 From: husejinbg Date: Tue, 19 Mar 2024 16:32:03 +0300 Subject: [PATCH] replaced deprecated BoxAnnotator with BoundingBoxAnnotator and LabelAnnotator BoxAnnotator is deprecated and will be removed in supervision-0.22.0, so I replaced it with BoundingBoxAnnotator and LabelAnnotator. --- deva/inference/result_utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/deva/inference/result_utils.py b/deva/inference/result_utils.py index 1d31fb6..e9dc90f 100644 --- a/deva/inference/result_utils.py +++ b/deva/inference/result_utils.py @@ -260,10 +260,13 @@ def save_result(queue: Queue): detections = sv.Detections(xyxy, confidence=np.array(all_scores), class_id=np.array(all_cat_ids)) - annotator = sv.BoxAnnotator() - blend = annotator.annotate(scene=blend, - detections=detections, - labels=labels) + box_annotator = sv.BoundingBoxAnnotator() + label_annotator = sv.LabelAnnotator() + blend = box_annotator.annotate(scene=blend, + detections=detections) + blend = label_annotator.annotate(scene=blend, + detections=detections, + labels=labels) if saver.dataset != 'gradio': # find a place to save the visualization