From 8d49c6a96918eb8afa1f51947c17871551c9b369 Mon Sep 17 00:00:00 2001 From: nihui Date: Thu, 7 Jul 2022 21:00:24 +0800 Subject: [PATCH 1/3] Update test.py --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 4f5671f..b43bc83 100644 --- a/test.py +++ b/test.py @@ -69,7 +69,7 @@ if __name__ == '__main__': print("forward time:%fms"%time) # 特征图后处理 - output = handel_preds(preds, device, opt.thresh) + output = handle_preds(preds, device, opt.thresh) # 加载label names LABEL_NAMES = [] From 559a0e95b9d19e6332b6b1a07342837f7c3ee8b0 Mon Sep 17 00:00:00 2001 From: nihui Date: Thu, 7 Jul 2022 21:00:42 +0800 Subject: [PATCH 2/3] Update tool.py --- utils/tool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/tool.py b/utils/tool.py index 021b71d..fd4ee4f 100644 --- a/utils/tool.py +++ b/utils/tool.py @@ -58,7 +58,7 @@ class EMA(): self.backup = {} # 后处理(归一化后的坐标) -def handel_preds(preds, device, conf_thresh=0.25, nms_thresh=0.45): +def handle_preds(preds, device, conf_thresh=0.25, nms_thresh=0.45): total_bboxes, output_bboxes = [], [] # 将特征图转换为检测框的坐标 N, C, H, W = preds.shape @@ -117,4 +117,4 @@ def handel_preds(preds, device, conf_thresh=0.25, nms_thresh=0.45): for i in keep: output.append(temp[i]) output_bboxes.append(torch.Tensor(output)) - return output_bboxes \ No newline at end of file + return output_bboxes From d9f65e37556b7a0301af911c258be6f4714d65e6 Mon Sep 17 00:00:00 2001 From: nihui Date: Thu, 7 Jul 2022 21:01:05 +0800 Subject: [PATCH 3/3] Update evaluation.py --- utils/evaluation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/evaluation.py b/utils/evaluation.py index f00f5cc..f7123b2 100644 --- a/utils/evaluation.py +++ b/utils/evaluation.py @@ -68,7 +68,7 @@ class CocoDetectionEvaluator(): # 模型预测 preds = model(imgs) # 特征图后处理 - output = handel_preds(preds, self.device, 0.001) + output = handle_preds(preds, self.device, 0.001) # 检测结果 N, _, H, W = imgs.shape