RandomExpand
问题确认 Search before asking
Bug组件 Bug Component
DataProcess
Bug描述 Describe the Bug
I found bug in RandomExpand transform
https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.6/ppdet/data/transform/operators.py#L1184-L1185C1
We need change this lines
if np.random.uniform(0., 1.) < self.prob:
return sample
to this
if np.random.uniform(0., 1.) >= self.prob:
return sample
复现环境 Environment
do not care
Bug描述确认 Bug description confirmation
- [X] 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.
是否愿意提交PR? Are you willing to submit a PR?
- [ ] 我愿意提交PR!I'd like to help by submitting a PR!
thanks,but I think the origin code is right
I think rydenisbak is probably right.
From what I understand prob is the probability that the image is randomly expanded.
The expected behavior is, if I set prob = 0, the image should never be expanded.
With the original code, we get some value between 0 and 1 which will never be les than 0. So we never return the original sample, we always return the expanded sample. This is contrary to the expected behavior.
if np.random.uniform(0., 1.) < self.prob:
return sample