NVlabs/SegFormer

Math wrong in Overlap Patch Merging

timdirr opened this issue · 0 comments

self.num_patches = self.H * self.W

As far as i understand it, self.num_patches is never used, but in my opinion the math behind its calculation is wrong.
self.H and self.W are calculated in the line above (L171), by dividing the original image size through the patch size. That is wrong.
The patch size does not determin the new image size, but rather the stride that is used. If i use patch size 100 but stride 1,1,
(in a padded conv of course) the output image will still have the same size as the input image. Therefor this math should be
incorrect.