diff options
Diffstat (limited to 'evaluate.py')
-rwxr-xr-x | evaluate.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/evaluate.py b/evaluate.py index 696356e..47d23a1 100755 --- a/evaluate.py +++ b/evaluate.py @@ -38,23 +38,23 @@ from logging import debug parser = argparse.ArgumentParser() parser.add_argument("-t", "--train", help="Use train data instead of query and gallery", action='store_true') parser.add_argument("-c", "--conf_mat", help="Show visual confusion matrix", action='store_true') -parser.add_argument("-k", "--kmean_alt", help="Perform clustering with generalized labels(not actual kmean)", action='store_true', default=0) -parser.add_argument("-m", "--mahalanobis", help="Perform Mahalanobis Distance metric", action='store_true', default=0) -parser.add_argument("-e", "--euclidean", help="Use standard euclidean distance", action='store_true', default=0) +parser.add_argument("-k", "--kmean_alt", help="Perform clustering with generalized labels(not actual kmean)", action='store_true') +parser.add_argument("-m", "--mahalanobis", help="Perform Mahalanobis Distance metric", action='store_true') +parser.add_argument("-e", "--euclidean", help="Use standard euclidean distance", action='store_true') parser.add_argument("-r", "--rerank", help="Use k-reciprocal rernaking", action='store_true') -parser.add_argument("-p", "--reranka", help="Parameter k1 for rerank -p '$k1val' -ARGUMENT REQUIRED, default=9-", type=int, default = 9) -parser.add_argument("-q", "--rerankb", help="Parameter k2 for rerank -q '$k2val' -ARGUMENT REQUIRED, default=3-", type=int, default = 3) -parser.add_argument("-l", "--rerankl", help="Coefficient to combine distances(lambda) -l '$lambdaval' -ARGUMENT REQUIRED, default=0.3-", type=float, default = 0.3) -parser.add_argument("-n", "--neighbors", help="Use customized ranklist size -n 'size' -ARGUMENT REQUIRED, default=1-", type=int, default = 1) +parser.add_argument("-a", "--reranka", help="Parameter k1 for rerank", type=int, default = 9) +parser.add_argument("-b", "--rerankb", help="Parameter k2 for rerank", type=int, default = 3) +parser.add_argument("-l", "--rerankl", help="Parameter lambda fo rerank", type=float, default = 0.3) +parser.add_argument("-n", "--neighbors", help="Use customized ranklist size NEIGHBORS", type=int, default = 1) parser.add_argument("-v", "--verbose", help="Use verbose output", action='store_true') -parser.add_argument("-s", "--showrank", help="Save ranklist pics id in a txt file. Number of ranklists saved specified as -s '$number' -ARGUMENT REQUIRED, default=0-", type=int, default = 0) -parser.add_argument("-1", "--normalise", help="Normalise features", action='store_true', default=0) -parser.add_argument("-M", "--multrank", help="Run for different ranklist sizes equal to M -ARGUMENT REQUIRED, default=1-", type=int, default=1) -parser.add_argument("-C", "--comparison", help="Set to 2 to obtain a comparison of baseline and improved metric -ARGUMENT REQUIRED, default=1-", type=int, default=1) -parser.add_argument("--data", help="You can either put the data in a folder called 'data', or specify the location with --data 'path' -ARGUMENT REQUIRED, default='data'-", default='data') -parser.add_argument("-K", "--kmean", help="Perform Kmean clustering of size specified through -K '$size' -ARGUMENT REQUIRED, default=0-", type=int, default=0) -parser.add_argument("-P", "--mAP", help="Display Mean Average Precision for ranklist of size -n '$size'", action='store_true') -parser.add_argument("-2", "--PCA", help="Use PCA with -2 '$n_components' -ARGUMENT REQUIRED, default=0-", type=int, default=0) +parser.add_argument("-s", "--showrank", help="Save ranklist pics id in a txt file for first SHOWRANK queries", type=int, default = 0) +parser.add_argument("-1", "--normalise", help="Normalise features", action='store_true') +parser.add_argument("-M", "--multrank", help="Run for different ranklist sizes equal to MULTRANK", type=int, default=1) +parser.add_argument("-C", "--comparison", help="Compare baseline and improved metric", action='store_true') +parser.add_argument("--data", help="Folder containing data", default='data') +parser.add_argument("-K", "--kmean", help="Perform Kmean clustering, KMEAN number of clusters", type=int, default=0) +parser.add_argument("-A", "--mAP", help="Display Mean Average Precision", action='store_true') +parser.add_argument("-P", "--PCA", help="Perform pca with PCA eigenvectors", type=int, default=0) args = parser.parse_args() @@ -242,7 +242,7 @@ def main(): accuracy[0] = draw_results(test_label, target_pred) else: - for q in range(args.comparison): + for q in range(args.comparison+1): target_pred = test_model(train_data, test_data, train_label, test_label, train_cam, test_cam, showfiles_train, showfiles_test, train_model, args) for i in range(args.multrank): accuracy[q][i] = draw_results(test_label, target_pred[i]) @@ -251,7 +251,7 @@ def main(): if(args.multrank != 1): plt.plot(test_table[:(args.multrank)], 100*accuracy[0]) - if(args.comparison!=1): + if(args.comparison): plt.plot(test_table[:(args.multrank)], 100*accuracy[1]) plt.legend(['Baseline NN', 'NN+Reranking'], loc='upper left') plt.xlabel('Top k') |