From 2254c5eeeff30cda700622d8a24f14403eda4038 Mon Sep 17 00:00:00 2001 From: yztongzhan Date: Mon, 8 Aug 2022 17:19:19 +0800 Subject: [PATCH] fix multi-clip testing --- engine_for_finetuning.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine_for_finetuning.py b/engine_for_finetuning.py index ec10f8a..6b79af9 100755 --- a/engine_for_finetuning.py +++ b/engine_for_finetuning.py @@ -7,6 +7,7 @@ from mixup import Mixup from timm.utils import accuracy, ModelEma import utils +from scipy.special import softmax def train_class_batch(model, samples, target, criterion): @@ -245,6 +246,7 @@ def merge(eval_path, num_tasks): chunk_nb = line.split(']')[1].split(' ')[2] split_nb = line.split(']')[1].split(' ')[3] data = np.fromstring(line.split('[')[1].split(']')[0], dtype=np.float, sep=',') + data = softmax(data) if not name in dict_feats: dict_feats[name] = [] dict_label[name] = 0