timm documentation

EfficientViT (MIT)

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

EfficientViT (MIT)

Category: Efficient/Mobile Β· Code: timm/models/efficientvit_mit.py Β· Architectures: 7 Β· Pretrained weights: 19 (19 with ImageNet-1k results)

EfficientViT from the MIT Han Lab, a vision backbone for high-resolution, low-computation recognition that uses multi-scale linear attention.

Papers

Usage

See the Quickstart for loading pretrained weights, image preprocessing and fine-tuning, and Feature Extraction for using the models as backbones.

>>> import timm
>>> model = timm.create_model('efficientvit_b2.r224_in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

Model API support

FeatureEfficientVitEfficientVitLarge
features_only=True feature mapsβœ“ (strides 4, 8, 16, 32)βœ“ (strides 4, 8, 16, 32)
forward_intermediates()βœ“βœ“
prune_intermediate_layers()βœ“βœ“
Any input size, no changes neededβœ“βœ“
set_input_size()––
dynamic_img_size=True––
set_grad_checkpointing()βœ“βœ“
Layer-wise LR decay (group_matcher())βœ“βœ“
reset_classifier()βœ“βœ“

βœ“ supported, βœ“ (square) works for square sizes only, βœ— not supported, – not needed (the model already accepts any input size). Checked by running each feature on a randomly initialized model (EfficientVit with efficientvit_b0 at 224, EfficientVitLarge with efficientvit_l1 at 224), other architectures of the same class are expected to behave the same. See the Model API page for details.

Architectures

ArchitectureClassParams (M)GMACsInput sizePretrained weights
efficientvit_b0EfficientVit3.410.102241
efficientvit_b1EfficientVit9.100.532243
efficientvit_b2EfficientVit24.331.602243
efficientvit_b3EfficientVit48.653.992243
efficientvit_l1EfficientVitLarge52.655.272241
efficientvit_l2EfficientVitLarge63.716.972244
efficientvit_l3EfficientVitLarge246.0427.622244

GMACs and parameter counts are for the default input size and classifier of each architecture, from the benchmark results.

Pretrained weights

Top-1 is ImageNet-1k validation accuracy from results-imagenet.csv at the listed eval size, - if the weight has no ImageNet-1k result (e.g. pretraining or image-text weights). Classes is the size of the pretrained classifier, none for weights without one.

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
efficientvit_b0.r224_in1k22471.4082241000apache-2.0timm
efficientvit_b1.r224_in1k22479.2542241000apache-2.0timm
efficientvit_b1.r256_in1k25679.7342561000apache-2.0timm
efficientvit_b1.r288_in1k28880.3222881000apache-2.0timm
efficientvit_b2.r224_in1k22482.1622241000apache-2.0timm
efficientvit_b2.r256_in1k25682.7122561000apache-2.0timm
efficientvit_b2.r288_in1k28883.0782881000apache-2.0timm
efficientvit_b3.r224_in1k22483.4442241000apache-2.0timm
efficientvit_b3.r256_in1k25683.7822561000apache-2.0timm
efficientvit_b3.r288_in1k28884.1622881000apache-2.0timm
efficientvit_l1.r224_in1k22484.4642241000apache-2.0timm
efficientvit_l2.r224_in1k22485.0462241000apache-2.0timm
efficientvit_l2.r256_in1k25685.3802561000apache-2.0timm
efficientvit_l2.r288_in1k28885.6142881000apache-2.0timm
efficientvit_l2.r384_in1k38485.9843841000apache-2.0timm
efficientvit_l3.r224_in1k22485.8102241000apache-2.0timm
efficientvit_l3.r256_in1k25685.9522561000apache-2.0timm
efficientvit_l3.r320_in1k32086.2303201000apache-2.0timm
efficientvit_l3.r384_in1k38486.3963841000apache-2.0timm
Update on GitHub