From 22940ff3e011b709688a61dd0238b99ed711a5f0 Mon Sep 17 00:00:00 2001 From: darkliang <11710911@mail.sustech.edu.cn> Date: Fri, 11 Mar 2022 22:24:21 +0800 Subject: [PATCH] add view angle result for OUMVLP --- lib/utils/evaluation.py | 6 +++++- misc/download_pretrained_model.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/utils/evaluation.py b/lib/utils/evaluation.py index 5aaed81..c8ccaaa 100644 --- a/lib/utils/evaluation.py +++ b/lib/utils/evaluation.py @@ -40,7 +40,7 @@ def de_diag(acc, each_angle=False): def identification(data, dataset, metric='euc'): msg_mgr = get_msg_mgr() - + feature, label, seq_type, view = data['embeddings'], data['labels'], data['types'], data['views'] label = np.array(label) view_list = list(set(view)) @@ -78,6 +78,7 @@ def identification(data, dataset, metric='euc'): np.sum(np.cumsum(np.reshape(probe_y, [-1, 1]) == gallery_y[idx[:, 0:num_rank]], 1) > 0, 0) * 100 / dist.shape[0], 2) result_dict = {} + np.set_printoptions(precision=3, suppress=True) if 'OUMVLP' not in dataset: for i in range(1): msg_mgr.log_info( @@ -108,6 +109,9 @@ def identification(data, dataset, metric='euc'): msg_mgr.log_info('NM: %.3f ' % (np.mean(acc[0, :, :, 0]))) msg_mgr.log_info('===Rank-1 (Exclude identical-view cases)===') msg_mgr.log_info('NM: %.3f ' % (de_diag(acc[0, :, :, 0]))) + msg_mgr.log_info( + '===Rank-1 of each angle (Exclude identical-view cases)===') + msg_mgr.log_info('NM: {}'.format(de_diag(acc[0, :, :, 0], True))) result_dict["scalar/test_accuracy/NM"] = de_diag(acc[0, :, :, 0]) return result_dict diff --git a/misc/download_pretrained_model.py b/misc/download_pretrained_model.py index c48bb6a..9e027b9 100644 --- a/misc/download_pretrained_model.py +++ b/misc/download_pretrained_model.py @@ -120,7 +120,7 @@ def download_file_and_uncompress(url, if __name__ == "__main__": urls = [ "https://github.com/ShiqiYu/OpenGait/releases/download/v1.0/pretrained_casiab_model.zip", - "https://github.com/ShiqiYu/OpenGait/releases/download/v1.0/pretrained_oumvlp_model.zip"] + "https://github.com/ShiqiYu/OpenGait/releases/download/v1.1/pretrained_oumvlp_model.zip"] for url in urls: download_file_and_uncompress( url=url, extrapath='output')