aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2018-12-04 15:33:43 +0000
committerVasil Zlatanov <v@skozl.com>2018-12-04 15:33:43 +0000
commit066b96d138ed6c4b611382bf4d134eef7ebbdbbf (patch)
tree9325a5f39817e979d7b2e10acc3bcf3637020c42
parenta8573c29ba5410b9b9e02b0c6624525447114fd6 (diff)
downloadvz215_np1915-066b96d138ed6c4b611382bf4d134eef7ebbdbbf.tar.gz
vz215_np1915-066b96d138ed6c4b611382bf4d134eef7ebbdbbf.tar.bz2
vz215_np1915-066b96d138ed6c4b611382bf4d134eef7ebbdbbf.zip
Remove inrank flag
-rwxr-xr-xpart2.py9
1 files 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]