amdegroot / ssd.pytorch

A PyTorch Implementation of Single Shot MultiBox Detector
MIT License
5.15k stars 1.75k forks source link

Questions about `RandSampleCrop` in `augmentation.py` #563

Closed zhiyiYo closed 3 years ago

zhiyiYo commented 3 years ago

Hi, In lines 259 and 260 of augmentation.py, the code is

left = random.uniform(width - w)
top = random.uniform(height - h)

I don't understand why the lower limit is set for 'left' and 'top', not the upper limit like

left = random.uniform(high=width - w)
top = random.uniform(high=height - h)
zhiyiYo commented 3 years ago

Strangely enough, I tested this function and found that if only one parameter is passed, it corresponds to high. image