From 689ab1f6e0f9923d06507d6835f2d0d068a83d22 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Wed, 5 Dec 2018 18:39:52 +0000 Subject: Replace verbose with logging --- lib/kmean.py | 2 ++ lib/rerank.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/kmean.py b/lib/kmean.py index 58309bc..f041b19 100644 --- a/lib/kmean.py +++ b/lib/kmean.py @@ -1,3 +1,4 @@ +from logging import debug import numpy as np from sklearn.cluster import KMeans @@ -39,6 +40,7 @@ def create_kmean_clusters(feature_vectors, labels, gallery_idx, camId): cllab.append(km_labels[i][j]) train_data = np.array(cl) + debug("Kmean data has shape", train_data.shape) train_label = np.array(cllab) train_cam = np.array([clustercam[i] for i in range(2)]).reshape(train_label.shape[0]) return train_data, train_label, train_cam diff --git a/lib/rerank.py b/lib/rerank.py index 6b20f53..6fb5b7b 100644 --- a/lib/rerank.py +++ b/lib/rerank.py @@ -1,5 +1,6 @@ from scipy.spatial.distance import cdist import numpy as np +from logging import debug def re_ranking(probFea,galFea,k1,k2,lambda_value, MemorySave = False, Minibatch = 2000): @@ -7,7 +8,7 @@ def re_ranking(probFea,galFea,k1,k2,lambda_value, MemorySave = False, Minibatch all_num = query_num + galFea.shape[0] feat = np.append(probFea,galFea,axis = 0) feat = feat.astype(np.float16) - print('computing original distance') + debug('computing original distance') if MemorySave: original_dist = np.zeros(shape = [all_num,all_num],dtype = np.float16) i = 0 @@ -29,7 +30,7 @@ def re_ranking(probFea,galFea,k1,k2,lambda_value, MemorySave = False, Minibatch initial_rank = np.argsort(original_dist).astype(np.int32) - print('starting re_ranking') + debug('starting re_ranking') for i in range(all_num): # k-reciprocal neighbors forward_k_neigh_index = initial_rank[i,:k1+1] -- cgit v1.2.3-54-g00ecf