VITA-Group / GLNet

[CVPR 2019, Oral] "Collaborative Global-Local Networks for Memory-Efficient Segmentation of Ultra-High Resolution Images" by Wuyang Chen*, Ziyu Jiang*, Zhangyang Wang, Kexin Cui, and Xiaoning Qian
MIT License
347 stars 76 forks source link

Training for rectangular images #20

Closed deepakanandece closed 4 years ago

deepakanandece commented 4 years ago

The parameters for downsampling images and cropping assume that the original image is square. What needs to be changed for rectangular images?

chenwydj commented 4 years ago

Thank you for your question!

Currently, I use the single argument size_g and size_p to define the size of the downsampled global image and the local patches.

For rectangular images, you need to change the arguments to size_g1, size_g2, size_p1 and size_p2 to define the new sizes. Actually, the only thing that matters are size_g1 and size_g2 in order to keep the downsampled global image having the same h/w ratio as your original high-resolution image. It still works if you set size_p1 = size_p2, since the global2patch function will dynamically decide the cropping strategy based on your global and local sizes.

chenwydj commented 4 years ago

Please re-open if further help is needed.