From d29714c868c785e7c6e9ac8d0536e733cb2f74ed Mon Sep 17 00:00:00 2001 From: FlyingQianMM <245467267@qq.com> Date: Thu, 7 May 2020 14:22:38 +0800 Subject: [PATCH] change im type from uint8 to float32 in randomexpand --- paddlex/cv/transforms/det_transforms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddlex/cv/transforms/det_transforms.py b/paddlex/cv/transforms/det_transforms.py index 2be4b3f..607c0a6 100644 --- a/paddlex/cv/transforms/det_transforms.py +++ b/paddlex/cv/transforms/det_transforms.py @@ -757,9 +757,9 @@ class RandomExpand: return (im, im_info, label_info) y = np.random.randint(0, h - height) x = np.random.randint(0, w - width) - canvas = np.ones((h, w, 3), dtype=np.uint8) - canvas *= np.array(self.fill_value, dtype=np.uint8) - canvas[y:y + height, x:x + width, :] = im.astype(np.uint8) + canvas = np.ones((h, w, 3), dtype=np.float32) + canvas *= np.array(self.fill_value, dtype=np.float32) + canvas[y:y + height, x:x + width, :] = im im_info['augment_shape'] = np.array([h, w]).astype('int32') if 'gt_bbox' in label_info and len(label_info['gt_bbox']) > 0: -- GitLab