From d5c03b9e97e1bc088cdc7fa7221e62d8892e33f2 Mon Sep 17 00:00:00 2001 From: krataratha Date: Tue, 23 Jun 2026 21:41:57 +0530 Subject: [PATCH] Update eval.py --- audio-visual/eval.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/audio-visual/eval.py b/audio-visual/eval.py index e78051c..79b21c1 100644 --- a/audio-visual/eval.py +++ b/audio-visual/eval.py @@ -8,6 +8,9 @@ parser = argparse.ArgumentParser(description='') parser.add_argument('--category', default='rvfa') +# New feature arguments +parser.add_argument('--lambda_percentile', type=float, default=3.0, help='Percentile value for thresholding') +parser.add_argument('--output_csv', type=str, default='', help='Path to save evaluation results') args = parser.parse_args() dir_RVRA = './RealVideo-RealAudio_features' @@ -37,7 +40,7 @@ all_rvra_paths = np.load(os.path.join(dir_RVRA, 'paths.npy'), allow_pickle=True) rvra_audio_video = [] -lambda_percentile = 3 +lambda_percentile = args.lambda_percentile for i in tqdm(range(rvra_audio.shape[0]), total=rvra_audio.shape[0]): cur_path = all_rvra_paths[i] @@ -62,9 +65,4 @@ fake_audio_video.append(np.percentile((fake_audio_unit * fake_vid_unit).sum(axis=1), lambda_percentile)) test_set = -np.concatenate((rvra_audio_video, fake_audio_video)) -labels = np.ones(len(test_set)) -labels[:len(rvra_audio_video)] = 0 - -auc = roc_auc_score(labels, test_set) -ap = average_precision_score(labels, test_set) -print(f'AP: {ap*100}, AUC: {auc*100}') \ No newline at end of file +labels =