aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasil Zlatanov <vasko@e4-pattern-vm.europe-west4-a.c.electric-orbit-223819.internal>2018-12-08 17:37:25 +0000
committerVasil Zlatanov <vasko@e4-pattern-vm.europe-west4-a.c.electric-orbit-223819.internal>2018-12-08 17:37:25 +0000
commitaaee9b10aab7c78c7a02d5caec4ed37b85dff1bd (patch)
tree7118bd9062ecd63ec67fa224e95451d5d861dac3
parentf6ee52c3f7f424ab8e7ce972281f0f6199b8262d (diff)
downloadvz215_np1915-aaee9b10aab7c78c7a02d5caec4ed37b85dff1bd.tar.gz
vz215_np1915-aaee9b10aab7c78c7a02d5caec4ed37b85dff1bd.tar.bz2
vz215_np1915-aaee9b10aab7c78c7a02d5caec4ed37b85dff1bd.zip
Use correct transpose for mahalanobis
-rwxr-xr-xevaluate.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/evaluate.py b/evaluate.py
index e8468a2..38b20bb 100755
--- a/evaluate.py
+++ b/evaluate.py
@@ -84,7 +84,7 @@ def test_model(gallery_data, probe_data, gallery_label, probe_label, gallery_cam
else:
if args.mahalanobis:
# metric = 'jaccard' is also valid
- cov_inv = np.linalg.inv(np.cov(gallery_data.T))
+ cov_inv = np.linalg.inv(np.cov(gallery_data.T)).T
distances = cdist(probe_data, gallery_data, 'mahalanobis', VI=cov_inv)
else:
distances = cdist(probe_data, gallery_data, 'euclidean')