From e9bea6bb29b352fd63fb4d3bc1ee854782d798b8 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Tue, 4 Dec 2018 15:37:28 +0000 Subject: Fix conditions for -n --- part2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/part2.py b/part2.py index 2afa9a8..b890837 100755 --- a/part2.py +++ b/part2.py @@ -103,8 +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.neighbors): - target_pred[probe_idx] = probe_label[probe_idx] + if (args.neighbors) and (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] -- cgit v1.2.3-54-g00ecf