open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.54k stars 9.46k forks source link

How does a two stage detector deals with input H W with different size in a single batch? #10729

Open sipie800 opened 1 year ago

sipie800 commented 1 year ago

I used to use detectron2, in which a FasterRCNN will resize the image in different sizes to a fixed size in one batch in order to form a tensor. And the resizing is implemented as a non-training torch module in model .

Now I'm using mmdet 3 and I wonder how it deals with it. When we use the multiscale training, the size of each image will be different in a batch. What happen after one image is resized to a random size and before it is feed into a FasterRCNN ?

hhaAndroid commented 1 year ago

@sipie800 Here https://github.com/open-mmlab/mmdetection/blob/main/mmdet/models/data_preprocessors/data_preprocessor.py#L31