diff --git a/ppdet/data/transform/operators.py b/ppdet/data/transform/operators.py index 03a09520f4ec54bdc96482fdb812fb307a0cf02f..c0d665746d671e15a880e981c4bb240a3e4f9bea 100644 --- a/ppdet/data/transform/operators.py +++ b/ppdet/data/transform/operators.py @@ -1032,11 +1032,10 @@ class Resize(BaseOperator): scale_x = dim / w scale_y = dim / h if 'gt_bbox' in sample and len(sample['gt_bbox']) > 0: - if self.scale_box or self.scale_box is None: - scale_array = np.array([scale_x, scale_y] * 2, - dtype=np.float32) - sample['gt_bbox'] = np.clip( - sample['gt_bbox'] * scale_array, 0, dim - 1) + scale_array = np.array([scale_x, scale_y] * 2, + dtype=np.float32) + sample['gt_bbox'] = np.clip( + sample['gt_bbox'] * scale_array, 0, dim - 1) sample['h'] = resize_h sample['w'] = resize_w