diff options
-rwxr-xr-x | evaluate.py | 3 |
1 files changed, 2 insertions, 1 deletions
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') |