gupta-abhay/pytorch-vit

Patch the image

nooralahzadeh opened this issue · 2 comments

How do you patch the image? any clues for the preprocessing and training step?

Working on this now. Should have some code over the next few days.

from einops import rearrange
p = self.patch_size
x = rearrange(img, 'b c (h p1) (w p2) -> b (h w) (p1 p2 c)', p1 = p, p2 = p)