From f6ee52c3f7f424ab8e7ce972281f0f6199b8262d Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Sat, 8 Dec 2018 17:31:55 +0000 Subject: Fix mahalanobis --- evaluate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evaluate.py b/evaluate.py index 6561b81..e8468a2 100755 --- a/evaluate.py +++ b/evaluate.py @@ -84,7 +84,8 @@ def test_model(gallery_data, probe_data, gallery_label, probe_label, gallery_cam else: if args.mahalanobis: # metric = 'jaccard' is also valid - distances = cdist(probe_data, gallery_data, 'jaccard') + cov_inv = np.linalg.inv(np.cov(gallery_data.T)) + distances = cdist(probe_data, gallery_data, 'mahalanobis', VI=cov_inv) else: distances = cdist(probe_data, gallery_data, 'euclidean') -- cgit v1.2.3-54-g00ecf