Open mixxs opened 5 months ago
I've tried using the following function to convert the output to an image, but it doesn't seem to work def unpatchify(self, x): """ x: (N, L, patch_size*2 3) imgs: (N, 3, H, W) """ N, L, Hid = x.shape patch_size = int((Hid / 3) 0.5) h = w = int(L 0.5) imgs = x.reshape((N, h, w, patch_size, patch_size, 3)) imgs = torch.einsum('nhwpqc->nchpwq', imgs) imgs = imgs.reshape((N, 3, h patch_size, w patch_size))
return imgs
Hello, how to convert the output of mim_swin_base_patch4_win7 to an image