aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2018-12-04 15:37:28 +0000
committerVasil Zlatanov <v@skozl.com>2018-12-04 15:37:28 +0000
commite9bea6bb29b352fd63fb4d3bc1ee854782d798b8 (patch)
tree4e98f66ba667500bf5472fbc769d3d6b59304c90
parent066b96d138ed6c4b611382bf4d134eef7ebbdbbf (diff)
downloadvz215_np1915-e9bea6bb29b352fd63fb4d3bc1ee854782d798b8.tar.gz
vz215_np1915-e9bea6bb29b352fd63fb4d3bc1ee854782d798b8.tar.bz2
vz215_np1915-e9bea6bb29b352fd63fb4d3bc1ee854782d798b8.zip
Fix conditions for -n
-rwxr-xr-xpart2.py4
1 files 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]