Merge pull request #7 from nihui/fix-typo

Fix typo for handle_preds
This commit is contained in:
xuehao.ma 2022-07-07 22:37:23 +08:00 committed by GitHub
commit 8c1d8e0f7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -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 = []

View File

@ -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

View File

@ -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
return output_bboxes