diff --git a/ppdet/data/transform/operators.py b/ppdet/data/transform/operators.py index df852584a587cf5aba873ffd1ea41d64360417c6..7eae8db0ba67a87a1337bd4a289d505aee365aaa 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