SAVRN
Search Contact SAVRN

Open-weight model · Image classification

vit-base-patch16-224

by Google google/vit-base-patch16-224

Vision Transformer (ViT) model pre-trained on ImageNet-21k (14 million images, 21,843 classes) at resolution 224x224, and fine-tuned on ImageNet 2012 (1 million images, 1,000 classes) at resolution 224x224.

Parameters87M
Context
Weights1.4 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads7.1M

Runs On

What it takes to serve vit-base-patch16-224 (87M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.2 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.0 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

SAVRN's Notes on vit-base-patch16-224

You will barely notice this one on a card. At 16-bit it needs 0.2 GB to run, and the cheapest setup we list, one MI300X with 192 GB at $1.85 an hour on demand, has room for it hundreds of times over. It sorts a 224 by 224 image into one of 1,000 ImageNet 2012 classes; Google pre-trained its 87M parameters on 14 million ImageNet-21k images. The accelerator question is images per hour and what else shares the card, never fit.

Apache 2.0 lets you fine-tune it to your own labels, run it commercially and redistribute it, provided the license and NOTICE file travel along and you state what you changed, with a patent grant included. Check that the 1,000 ImageNet labels cover your need; anything else means training a new head on your data. The weights date from September 2023 and are a conversion from the timm repository.

Model Card

By Google, published under apache-2.0, revision 3f49326eb077.

Vision Transformer (base-sized model)

Vision Transformer (ViT) model pre-trained on ImageNet-21k (14 million images, 21,843 classes) at resolution 224x224, and fine-tuned on ImageNet 2012 (1 million images, 1,000 classes) at resolution 224x224. It was introduced in the paper An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale by Dosovitskiy et al. and first released in this repository. However, the weights were converted from the timm repository by Ross Wightman, who already converted the weights from JAX to PyTorch. Credits go to him.

Disclaimer: The team releasing ViT did not write a model card for this model so this model card has been written by the Hugging Face team.

Model description

Read the full model card (672 words)

Configuration

Architecture
ViTForImageClassification
Layers
12
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Model type
vit

Identity and Version

Repository
google/vit-base-patch16-224
Publisher
Google
Task
Image classification
Modality
Image
Library
transformers
Parameters
87M parameters
Languages
tf, jax, vit
Revision
3f49326eb077187dfe1c2a2bb15fbd74e6ab91e3
First published
2022-03-02
Last updated
2023-09-05

Files and Weights

8 files, 1.4 GB in total. The weights are 4 files totalling 1.4 GB in bin, h5, msgpack, safetensors.

Weights4 files · 1.4 GB
Configuration2 files · 69.8 KB
Documentation1 file · 5.7 KB
Repository1 file · 744 B
Every file
FileTypeSizeSHA-256
flax_model.msgpackWeights346.3 MB e0c809a1fe1d
model.safetensorsWeights346.3 MB 1cea07110a4a
pytorch_model.binWeights346.4 MB 5f1706766812
tf_model.h5Weights346.5 MB 30f912542306
config.jsonConfiguration69.7 KB
preprocessor_config.jsonConfiguration160 B
README.mdDocumentation5.7 KB
.gitattributesRepository744 B

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
1.4 GB
Download from Google

Released by Google through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published1.4 GB
16-bit0.2 GB
8-bit0.1 GB
4-bit0.0 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Built on This Model

Compare vit-base-patch16-224

Questions About vit-base-patch16-224

How much GPU memory does vit-base-patch16-224 need?

About 0.2 GB at 16-bit and 0.1 GB at 4-bit: the weights (87M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run vit-base-patch16-224 on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use vit-base-patch16-224 commercially?

Yes. vit-base-patch16-224 is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

A Vision Transformer (ViT) image classification model. Trained on ImageNet-21k by paper authors and (re) fine-tuned on ImageNet-1k with additional augmentation and regularization by Ross Wightman. - How to train your ViT? Data, Augmentation, and Regularization in Vision Transformers: https://arxiv.org/abs/2106.10270 - An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale: https://arxiv.org/abs/2010.11929v2 Explore the dataset and runtime metrics of this model in timm model results.

Open weights apache-2.0 87M parameters timm

A Vision Transformer (ViT) image classification model. Trained on ImageNet-21k and fine-tuned on ImageNet-1k (with additional augmentation and regularization) in JAX by paper authors, ported to PyTorch by Ross Wightman. - How to train your ViT? Data, Augmentation, and Regularization in Vision Transformers: https://arxiv.org/abs/2106.10270 - An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale: https://arxiv.org/abs/2010.11929v2 Explore the dataset and runtime metrics of this model in timm model results.

Open weights apache-2.0 87M parameters timm

A Vision Transformer (ViT) image classification model. Trained on ImageNet-21k by paper authors and (re) fine-tuned on ImageNet-1k with additional augmentation and regularization by Ross Wightman. - How to train your ViT? Data, Augmentation, and Regularization in Vision Transformers: https://arxiv.org/abs/2106.10270 - An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale: https://arxiv.org/abs/2010.11929v2 Explore the dataset and runtime metrics of this model in timm model results.

Open weights apache-2.0 87M parameters timm

Model · Image classification

nsfw_image_detector

Freepik

This model is a vision transformer based on the EVA architecture, fine-tuned for NSFW content classification. It has been trained to detect four categories (neutral, low, medium, high) of visual content using 100,000 synthetically labeled images. The model can be used as a binary (true/false) classifier if desired, or you can obtain the full output probabilities.. It outperforms other excellent publicly available models such as Falconsai/nsfwimagedetection or AdamCodd/vit-base-nsfw-detector in our internal benchmarks adding the enrichment of being able to select the NSFW level that suits your use case. You can try this model directly in your browser through our Hugging Face Space. Upload…

Open weights mit 86M parameters transformers

A Vision Transformer (ViT) image classification model. Trained on ImageNet-21k and fine-tuned on ImageNet-1k (with additional augmentation and regularization) in JAX by paper authors, ported to PyTorch by Ross Wightman. - How to train your ViT? Data, Augmentation, and Regularization in Vision Transformers: https://arxiv.org/abs/2106.10270 - An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale: https://arxiv.org/abs/2010.11929v2 Explore the dataset and runtime metrics of this model in timm model results.

Open weights apache-2.0 87M parameters timm

Model · Image classification

vit-base-nsfw-detector

AdamCodd

This model is a fine-tuned version of vit-base-patch16-384 on around 25000 images (drawings, photos...). It achieves the following results on the evaluation set: New [07/30]: I created a new ViT model specifically to detect NSFW/SFW images for stable diffusion usage (read the disclaimer below for the reason): AdamCodd/vit-nsfw-stable-diffusion. Disclaimer: This model wasn't made with generative images in mind! There is no generated image in the dataset used here, and it performs significantly worse on generative images, which will require another ViT model specifically trained on generative images. Here are the model's actual scores for generative images to give you an idea: The Vision…

Open weights apache-2.0 86M parameters transformers.js