diff options
author | nunzip <np.scarh@gmail.com> | 2018-12-11 02:32:22 +0000 |
---|---|---|
committer | nunzip <np.scarh@gmail.com> | 2018-12-11 02:32:22 +0000 |
commit | 132d2dabcf4b7c2e9f7ce31a9ac68721be24ea96 (patch) | |
tree | 5ce743d378e9b0900b9f11d81ed9d64455fcd31a | |
parent | 15d176da31c51cc0ee8af9c933f0a7b606613bea (diff) | |
download | vz215_np1915-132d2dabcf4b7c2e9f7ce31a9ac68721be24ea96.tar.gz vz215_np1915-132d2dabcf4b7c2e9f7ce31a9ac68721be24ea96.tar.bz2 vz215_np1915-132d2dabcf4b7c2e9f7ce31a9ac68721be24ea96.zip |
Add PCA
-rwxr-xr-x | evaluate.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/evaluate.py b/evaluate.py index 848eb84..3475ef8 100755 --- a/evaluate.py +++ b/evaluate.py @@ -54,6 +54,7 @@ parser.add_argument("-C", "--comparison", help="Set to 2 to obtain a comparison 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", action='store_true') args = parser.parse_args() @@ -208,6 +209,11 @@ def main(): train_cam = camId[gallery_idx] test_cam = camId[query_idx] + if(args.PCA): + pca=PCA(n_components=300) #Reconstruction error of 2.3% @300 + train_data=pca.fit_transform(train_data) + test_data=pca.transform(test_data) + accuracy = np.zeros((2, args.multrank)) test_table = np.arange(1, args.multrank+1) |