def euclidean(bb_test_, bb_gt_):
"""
Computes similarity using euclidean distance between
two bboxes in the form [x, y, z, s, r, yaw]
using 1/ (1 + euclidean_dist)
"""
x1, y1, z1, s1, r1, yaw1 = get_bbox(bb_test_)
x2, y2, z2, s2, r2, yaw2 = get_bbox(bb_gt_)
# o = (np.sum(squared_diff(i,j) for (i,j) in [(x1, x2), (y1, y2), (yaw1, yaw2)]))
# this is not jit compatible. resort to using for loop:
output = 0.
for (i, j) in [(x1, x2), (y1, y2), (z1, z2), (yaw1, yaw2), (s1, s2), (r1, r2)]:
output += squared_diff(i, j)
output = 1./(1. + (output ** (1 / 2.)))
# print('distance {}'.format(o))
return(output)
评论列表
文章目录