aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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]