diff options
author | Vasil Zlatanov <v@skozl.com> | 2018-12-08 18:32:11 +0000 |
---|---|---|
committer | Vasil Zlatanov <v@skozl.com> | 2018-12-08 18:32:11 +0000 |
commit | 19c6eb523865bd97be60cf93da72d42263760efc (patch) | |
tree | 267da36eec54fc3f24352c43d11834c8de25ccd8 | |
parent | f6ee52c3f7f424ab8e7ce972281f0f6199b8262d (diff) | |
download | vz215_np1915-19c6eb523865bd97be60cf93da72d42263760efc.tar.gz vz215_np1915-19c6eb523865bd97be60cf93da72d42263760efc.tar.bz2 vz215_np1915-19c6eb523865bd97be60cf93da72d42263760efc.zip |
Add print functions to mahalanobis
-rwxr-xr-x | evaluate.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/evaluate.py b/evaluate.py index e8468a2..604d0b4 100755 --- a/evaluate.py +++ b/evaluate.py @@ -85,7 +85,10 @@ def test_model(gallery_data, probe_data, gallery_label, probe_label, gallery_cam if args.mahalanobis: # metric = 'jaccard' is also valid cov_inv = np.linalg.inv(np.cov(gallery_data.T)) - distances = cdist(probe_data, gallery_data, 'mahalanobis', VI=cov_inv) + distances = np.zeros((probe_data.shape[0], gallery_data.shape[0])) + for i in range(int(probe_data.shape[0]/10)): + print("Comupting from", i*10, "to", (i+1)*10-1) + distances[i*10:(i+1)*10-1] = cdist(probe_data[i*10:(i+1)*10-1], gallery_data, 'mahalanobis', VI=cov_inv) else: distances = cdist(probe_data, gallery_data, 'euclidean') |