From 42b8c17a722f2239d90dd156fef8e987c7e1b06e Mon Sep 17 00:00:00 2001 From: shaoeric <37291832+shaoeric@users.noreply.github.com> Date: Thu, 27 Feb 2020 15:43:56 +0800 Subject: [PATCH] correct center_size --- layers/box_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layers/box_utils.py b/layers/box_utils.py index 84214947b..d71284c4e 100644 --- a/layers/box_utils.py +++ b/layers/box_utils.py @@ -22,8 +22,8 @@ def center_size(boxes): Return: boxes: (tensor) Converted xmin, ymin, xmax, ymax form of boxes. """ - return torch.cat((boxes[:, 2:] + boxes[:, :2])/2, # cx, cy - boxes[:, 2:] - boxes[:, :2], 1) # w, h + return torch.cat(((boxes[:, 2:] + boxes[:, :2])/2, # cx, cy + boxes[:, 2:] - boxes[:, :2]), 1) # w, h def intersect(box_a, box_b):