aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xevaluate.py5
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')