open-mmlab / mmdetection

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

Questions on handling images of different sizes with DataContainer #6901

Open DianCh opened 2 years ago

DianCh commented 2 years ago

Hi! I was wondering how images of different sizes are stacked together in a batch. I had a feeling that the content is copied to the top-left corner of a padded image tensor, and noticed that DataContainer is designed to deal with this. However DataContainer looks like a bare skeleton that doesn't have many operations defined, and I don't know where to find the collate function after Collect in the pipeline. How does the collate function work? And could you point me to the right place to check the implementation?

Thank you!

hhaAndroid commented 2 years ago

@DianCh Please refer to collate funtion