how to calculate median distance?
asw91666 opened this issue · 1 comments
asw91666 commented
Hello!
I have a question regarding the method of calculating the median distance. When computing the median distance, do you perform the np.median() operation along both the vertices axis and the batch axis?
For example, let's say we have pred_vertices with the shape [100,5023,3], and we've identified the corresponding ground truth vertices, which is in the shape of [100,5023,3].
then I can get median distance through this code:
l2_norm = np.sqrt(np.sum((pred_vertices - gt_vertices) ** 2, axis=2)) # [B,5023]
median_distance = np.median(np.median(l2_norm, axis=1), axis=0)
Is that right?
Zvyozdo4ka commented
I think it is right, as to find the median distance between points in a point cloud, you should calculate the pairwise distances between all points and then find the median of these distances.
May I ask you, how are you going employ median distance?