This modification makes it possible to recalculate the bboxes of the masks in order to have a bbox relating to the mask.
Basically, the bbox is the one predicted by autodistill_grounding_dino. Then autodistill_grounded_sam uses this bbox to predict a mask. But the bbox does not correspond directly to the mask.
I therefore use mask_to_xyxy() of supervision to recalculate the bboxes relating to the masks.
According to the pull request https://github.com/roboflow/supervision/pull/1086
This modification makes it possible to recalculate the bboxes of the masks in order to have a bbox relating to the mask.
Basically, the bbox is the one predicted by autodistill_grounding_dino. Then autodistill_grounded_sam uses this bbox to predict a mask. But the bbox does not correspond directly to the mask.
I therefore use
mask_to_xyxy()
of supervision to recalculate the bboxes relating to the masks.