From be0ca534c6ffc2636d0b87939c8f73f9b9bbc621 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Mon, 24 May 2021 10:50:42 +0800 Subject: [PATCH] support BatchRandomResize for 2-D input (#3135) --- ppdet/data/transform/batch_operators.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ppdet/data/transform/batch_operators.py b/ppdet/data/transform/batch_operators.py index 253eae815..fff73d52b 100644 --- a/ppdet/data/transform/batch_operators.py +++ b/ppdet/data/transform/batch_operators.py @@ -136,7 +136,8 @@ class BatchRandomResize(BaseOperator): def __call__(self, samples, context=None): if self.random_size: - target_size = np.random.choice(self.target_size) + index = np.random.choice(len(self.target_size)) + target_size = self.target_size[index] else: target_size = self.target_size -- GitLab