A Pytorch Reproduction of Masked Generative Image Transformer
Victor Besnier, Mickael Chen
TL;DR
Problem: reproducing masked generative image models like MaskGIT has been hindered by limited public code and weights. Approach: this work provides a PyTorch reproduction using VQGAN tokenization and a bidirectional transformer to unmask tokens, trained on ImageNet 256x256 and 512x512. Findings: the replication achieves FID close to the original (≈7.3 at 512x512; 6.8 at 256x256; 7.26 with minor tweaks) and confirms 64x faster sampling compared to autoregressive methods; ablations show benefits from Gumbel noise and arccos scheduling. Significance: releasing code and pretrained weights accelerates research and reproducibility of Masked Generative Models.
Abstract
In this technical report, we present a reproduction of MaskGIT: Masked Generative Image Transformer, using PyTorch. The approach involves leveraging a masked bidirectional transformer architecture, enabling image generation with only few steps (8~16 steps) for 512 x 512 resolution images, i.e., ~64x faster than an auto-regressive approach. Through rigorous experimentation and optimization, we achieved results that closely align with the findings presented in the original paper. We match the reported FID of 7.32 with our replication and obtain 7.59 with similar hyperparameters on ImageNet at resolution 512 x 512. Moreover, we improve over the official implementation with some minor hyperparameter tweaking, achieving FID of 7.26. At the lower resolution of 256 x 256 pixels, our reimplementation scores 6.80, in comparison to the original paper's 6.18. To promote further research on Masked Generative Models and facilitate their reproducibility, we released our code and pre-trained weights openly at https://github.com/valeoai/MaskGIT-pytorch/
