From 19c6eb523865bd97be60cf93da72d42263760efc Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Sat, 8 Dec 2018 18:32:11 +0000 Subject: Add print functions to mahalanobis --- evaluate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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') -- cgit v1.2.3-54-g00ecf