Beispiel #1
0
 def distance(self, a, b):
     a_bbox = self.instance_map[id(a)][1]
     b_bbox = self.instance_map[id(b)][1]
     if bbox_iou(a_bbox, b_bbox) <= 0:
         return 0
     bbox = mean_bbox([a_bbox, b_bbox])
     return OKS(a, b, sigma=self.sigma, bbox=bbox)
Beispiel #2
0
 def iou(self, other):
     from datumaro.util.annotation_util import bbox_iou
     return bbox_iou(self.get_bbox(), other.get_bbox())
Beispiel #3
0
 def iou(self, other: _Shape) -> Union[float, Literal[-1]]:
     from datumaro.util.annotation_util import bbox_iou
     return bbox_iou(self.get_bbox(), other.get_bbox())