From 082b1ac9b23d5b21d45f77d707ef87d038e737cf Mon Sep 17 00:00:00 2001 From: wangxinxin08 <69842442+wangxinxin08@users.noreply.github.com> Date: Tue, 22 Mar 2022 21:09:30 +0800 Subject: [PATCH] fix transform problem of RandomCrop (#5412) --- ppdet/data/transform/operators.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ppdet/data/transform/operators.py b/ppdet/data/transform/operators.py index df852584a..7eae8db0b 100644 --- a/ppdet/data/transform/operators.py +++ b/ppdet/data/transform/operators.py @@ -1504,6 +1504,11 @@ class RandomCrop(BaseOperator): if 'is_crowd' in sample: sample['is_crowd'] = np.take( sample['is_crowd'], valid_ids, axis=0) + + if 'difficult' in sample: + sample['difficult'] = np.take( + sample['difficult'], valid_ids, axis=0) + return sample return sample -- GitLab