aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xevaluate.py6
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)