From 066b96d138ed6c4b611382bf4d134eef7ebbdbbf Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Tue, 4 Dec 2018 15:33:43 +0000 Subject: Remove inrank flag --- part2.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/part2.py b/part2.py index 7bb72d2..2afa9a8 100755 --- a/part2.py +++ b/part2.py @@ -41,7 +41,6 @@ parser.add_argument("-ka", "--reranka", help="Parameter 1 for Rerank", type=int, parser.add_argument("-kb", "--rerankb", help="Parameter 2 for rerank", type=int, default = 6) parser.add_argument("-n", "--neighbors", help="Number of neighbors", type=int, default = 1) parser.add_argument("-v", "--verbose", help="Use verbose output", action='store_true') -parser.add_argument("-i", "--inrank", help="Checks Accuracy based on presence of label in ranklist", action='store_true', default=0) parser.add_argument("-s", "--showrank", help="Save ranklist pic id in a txt file", type=int, default = 0) parser.add_argument("-2", "--graphspace", help="Graph space", action='store_true', default=0) parser.add_argument("-1", "--norm", help="Normalized features", action='store_true', default=0) @@ -104,12 +103,8 @@ def test_model(gallery_data, probe_data, gallery_label, probe_label, gallery_cam nnshowrank[probe_idx][q] = showfiles_train[row[n]] # q += 1 n += 1 - if (args.inrank): - if (probe_label[probe_idx] in nneighbors[probe_idx]): - target_pred[probe_idx] = probe_label[probe_idx] - else: - target_pred[probe_idx] = nneighbors[probe_idx][0] - + if (args.neighbors): + target_pred[probe_idx] = probe_label[probe_idx] else: target_pred[probe_idx] = nneighbors[probe_idx][0] -- cgit v1.2.3-54-g00ecf