Reconstruction seems very Bad with MaskBit-Tokenizer (18* bits)
I have tested few samples and It's seem very bad
Input
Output
Also, Other VQGAN choice of proprocessing [-1, 1] and in here why it is [0, 1]
Checked with other model too, All are giving very bad results too. Can you share script for a sample reconstruction?
def prepare_image(img):
""" Transform and normalize PIL Image to tensor. """
transform = T.Compose([
T.RandomResizedCrop(256, scale=(1., 1.), ratio=(1., 1.), interpolation=T.InterpolationMode.BICUBIC),
T.ToTensor(),
])
arr = transform(img)
return arr
Hi, what you observe is a dataset bias. Models trained on ImageNet have a lot of issues in reconstructing faces. This is common issues that all model that are only trained on ImageNet will have. If you want it the model to work with human faces, I'd encourage you to train on datasets such as FFHQ.
I can add an example script soon.
For me it would also be interesting to know why the image data is normalized between [0,1] and not [-1,1]?
Certainly!
We followed Huggingface's open muse implementation for the dataset preprocessing. I have tried to switch from [0,1] to [-1,1], but that had no positive effect back then. Moreover, it would only affect the first convolution, as we have normalisation directly after that layer anyway. That being said, if you experience improvements with different normalisation or have some pointers on literature discussing this, I would like to learn more about it!
Added demo notebook.