diff options
author | Vasil Zlatanov <v@skozl.com> | 2018-12-08 17:31:55 +0000 |
---|---|---|
committer | Vasil Zlatanov <v@skozl.com> | 2018-12-08 17:31:55 +0000 |
commit | f6ee52c3f7f424ab8e7ce972281f0f6199b8262d (patch) | |
tree | ac86eb4fb0e7d6dbdab4d6d5aa78f8f226140e29 | |
parent | dd475ccd3dde8949ca168f09ce048865fe0f5b40 (diff) | |
download | vz215_np1915-f6ee52c3f7f424ab8e7ce972281f0f6199b8262d.tar.gz vz215_np1915-f6ee52c3f7f424ab8e7ce972281f0f6199b8262d.tar.bz2 vz215_np1915-f6ee52c3f7f424ab8e7ce972281f0f6199b8262d.zip |
Fix mahalanobis
-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') |