Google Research's pretrained Vision Transformer and MLP-Mixer image models with JAX/Flax fine-tuning code
open sourceApache-2.0free
This repository releases Google Research's Vision Transformer (ViT) and MLP-Mixer image models from the papers that introduced them and from follow-up work (How to train your ViT?, SAM and GSAM training, LiT). The checkpoints were pre-trained on ImageNet and ImageNet-21k, in sizes from Ti/16 to L/16 plus hybrid ResNet variants, and download from Google Cloud Storage buckets; more than 50,000 checkpoints from the How to train your ViT? paper are included. The code fine-tunes them on TensorFlow Datasets in JAX and Flax, on GPU or TPU, and Colab notebooks explore and fine-tune them. The timm PyTorch library can load the checkpoints directly. The original training code lives in Google's big_vision repository, and the README says it isn't an official Google product.
Problems it solves
- a pretrained vision transformer I can fine-tune for image classification
- download ViT checkpoints trained on ImageNet-21k
- fine-tune an image classifier in JAX on a TPU
Features
- pretrained ViT and MLP-Mixer checkpoints on ImageNet and ImageNet-21k
- more than 50,000 checkpoints from the How to train your ViT? paper
- JAX and Flax fine-tuning on GPU or TPU, with Colab notebooks
- checkpoints that timm can load directly in PyTorch
Limitations
- The README says this isn't an official Google product, and the more advanced training code (multi-host training, original training scripts) is in the separate big_vision repository.1
Alternatives
The same job
These do what Vision Transformer (ViT) and MLP-Mixer does.
- DINOv2 Self-supervised vision models that produce general-purpose image features
- CLIP (OpenAI) OpenAI's open image-text model for zero-shot image classification
Compare Vision Transformer (ViT) and MLP-Mixer with the top 3
