diff options
author | nunzip <np.scarh@gmail.com> | 2018-12-13 00:53:43 +0000 |
---|---|---|
committer | nunzip <np.scarh@gmail.com> | 2018-12-13 00:53:43 +0000 |
commit | 34ef39354a48146fff99d9fcbb1882ae50f9a627 (patch) | |
tree | 456e199100c81e3201676ff6383664590fd60fb1 | |
parent | 9631be5a9b9e90f74b3484632ab5d9f379334a50 (diff) | |
download | vz215_np1915-34ef39354a48146fff99d9fcbb1882ae50f9a627.tar.gz vz215_np1915-34ef39354a48146fff99d9fcbb1882ae50f9a627.tar.bz2 vz215_np1915-34ef39354a48146fff99d9fcbb1882ae50f9a627.zip |
Fix evaluate -M -A bug
-rwxr-xr-x | evaluate.py | 7 | ||||
-rwxr-xr-x | opt.py | 16 |
2 files changed, 11 insertions, 12 deletions
diff --git a/evaluate.py b/evaluate.py index b178abc..a19a7a9 100755 --- a/evaluate.py +++ b/evaluate.py @@ -155,8 +155,11 @@ def test_model(gallery_data, probe_data, gallery_label, probe_label, gallery_cam AP[i] = sum(max_level_precision[i])/11 mAP = np.mean(AP) print('mAP:',mAP) - return target_pred, mAP - return target_pred + + if args.mAP: + return target_pred, mAP + else: + return target_pred def main(): logging.debug("Verbose mode is on") @@ -99,18 +99,14 @@ def eval(camId, filelist, labels, gallery_idx, train_idx, feature_vectors, args) train_data=pca.transform(train_data) test_data=pca.transform(test_data) - accuracy = np.zeros((2, args.multrank)) - test_table = np.arange(1, args.multrank+1) - 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, train_model, args) - + if args.mAP: + target_pred, mAP = test_model(train_data, test_data, train_label, test_label, train_cam, test_cam, showfiles_train, showfiles_test, train_model, args) + return mAP + else: 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): - return draw_results(test_label, target_pred[i]) - args.rerank = True - args.neighbors = 1 + target_pred = target_pred.reshape(target_pred.shape[1]) + return draw_results(test_label, target_pred) def kopt(camId, filelist, labels, gallery_idx, train_idx, feature_vectors, args): axis = 0 |