diff options
author | nunzip <np.scarh@gmail.com> | 2018-12-12 18:23:30 +0000 |
---|---|---|
committer | nunzip <np.scarh@gmail.com> | 2018-12-12 18:23:30 +0000 |
commit | 48c608204c4521e62aafa53b06082ebd50cbeedd (patch) | |
tree | 1563c5ab4491c9723bd1796c4ca3811dc8f0a471 | |
parent | 2a0d9cc0167968ccd6bd4a4a01b167e99361c6c3 (diff) | |
download | vz215_np1915-48c608204c4521e62aafa53b06082ebd50cbeedd.tar.gz vz215_np1915-48c608204c4521e62aafa53b06082ebd50cbeedd.tar.bz2 vz215_np1915-48c608204c4521e62aafa53b06082ebd50cbeedd.zip |
Fix flags
-rwxr-xr-x | opt.py | 35 |
1 files changed, 18 insertions, 17 deletions
@@ -36,25 +36,26 @@ import logging 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() @@ -235,7 +236,7 @@ def eval(camId, filelist, labels, gallery_idx, train_idx, feature_vectors, args) accuracy[0] = draw_results(test_label, target_pred) else: - for q in range(args.comparison): + for q in range(args.comparison+1): if args.mAP: return test_model(train_data, test_data, train_label, test_label, train_cam, test_cam, showfiles_train, showfiles_test, args) @@ -247,7 +248,7 @@ def eval(camId, filelist, labels, gallery_idx, train_idx, feature_vectors, args) 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') |