aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2018-12-08 17:31:55 +0000
committerVasil Zlatanov <v@skozl.com>2018-12-08 17:31:55 +0000
commitf6ee52c3f7f424ab8e7ce972281f0f6199b8262d (patch)
treeac86eb4fb0e7d6dbdab4d6d5aa78f8f226140e29
parentdd475ccd3dde8949ca168f09ce048865fe0f5b40 (diff)
downloadvz215_np1915-f6ee52c3f7f424ab8e7ce972281f0f6199b8262d.tar.gz
vz215_np1915-f6ee52c3f7f424ab8e7ce972281f0f6199b8262d.tar.bz2
vz215_np1915-f6ee52c3f7f424ab8e7ce972281f0f6199b8262d.zip
Fix mahalanobis
-rwxr-xr-xevaluate.py3
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')