Skip to content

Commit

Permalink
replaced deprecated BoxAnnotator with BoundingBoxAnnotator and LabelA…
Browse files Browse the repository at this point in the history
…nnotator

BoxAnnotator is deprecated and will be removed in supervision-0.22.0, so I replaced it with BoundingBoxAnnotator and LabelAnnotator.
  • Loading branch information
husejinbg committed Mar 19, 2024
1 parent 04a7eff commit 4b35c7a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions deva/inference/result_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b35c7a

Please sign in to comment.