From 911112265a99b17f487f4902e1e979f0dc784d7f Mon Sep 17 00:00:00 2001 From: wangxinxin08 <69842442+wangxinxin08@users.noreply.github.com> Date: Sat, 19 Mar 2022 20:38:52 +0800 Subject: [PATCH] fix register_buffer (#5398) --- ppdet/modeling/bbox_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ppdet/modeling/bbox_utils.py b/ppdet/modeling/bbox_utils.py index db8ef9e42..11f504f80 100644 --- a/ppdet/modeling/bbox_utils.py +++ b/ppdet/modeling/bbox_utils.py @@ -763,8 +763,9 @@ def batch_distance2bbox(points, distance, max_shapes=None): Tensor: Decoded bboxes, "x1y1x2y2" format. """ lt, rb = paddle.split(distance, 2, -1) - x1y1 = points - lt - x2y2 = points + rb + # while tensor add parameters, parameters should be better placed on the second place + x1y1 = -lt + points + x2y2 = rb + points out_bbox = paddle.concat([x1y1, x2y2], -1) if max_shapes is not None: max_shapes = max_shapes.flip(-1).tile([1, 2]) -- GitLab