cheind / py-motmetrics

:bar_chart: Benchmark multiple object trackers (MOT) in Python
MIT License
1.36k stars 259 forks source link

MOTP with euclidean distance metric gives mean squared distance. #161

Open angelcarro opened 2 years ago

angelcarro commented 2 years ago

When usign motmetrics.utils.compare_to_groundtruth() function with dist='euc', the distance metric is configured to the squared euclidean distance (norm2squared_matrix). As a consequence, the distance threshold (distth) should be the maximum squared distance. Also, the MOTP metric returns the mean squared distance.

The compute_euc() function can be modified to obtain the desired/expected units. https://github.com/cheind/py-motmetrics/blob/1ad168c1f194e2ae06102d368d561b2f4f82fda3/motmetrics/utils.py#L54

    def compute_euc(a, b):
        return np.sqrt(norm2squared_matrix(a, b, max_d2=distth**2))

I don't think this will have much impact on the computation time.

cheind commented 1 year ago

Hey, sorry for the late reply. Yes that seems like an oversight when we added euclidean distance metrics. Would you mind opening a PR?