timm documentation
EfficientViT (MIT)
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
| Feature | EfficientVit | EfficientVitLarge |
|---|---|---|
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
| Architecture | Class | Params (M) | GMACs | Input size | Pretrained weights |
|---|---|---|---|---|---|
efficientvit_b0 | EfficientVit | 3.41 | 0.10 | 224 | 1 |
efficientvit_b1 | EfficientVit | 9.10 | 0.53 | 224 | 3 |
efficientvit_b2 | EfficientVit | 24.33 | 1.60 | 224 | 3 |
efficientvit_b3 | EfficientVit | 48.65 | 3.99 | 224 | 3 |
efficientvit_l1 | EfficientVitLarge | 52.65 | 5.27 | 224 | 1 |
efficientvit_l2 | EfficientVitLarge | 63.71 | 6.97 | 224 | 4 |
efficientvit_l3 | EfficientVitLarge | 246.04 | 27.62 | 224 | 4 |
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.
| Weight | Input size | Top-1 (%) | Eval size | Classes | License | Hub |
|---|---|---|---|---|---|---|
efficientvit_b0.r224_in1k | 224 | 71.408 | 224 | 1000 | apache-2.0 | timm |
efficientvit_b1.r224_in1k | 224 | 79.254 | 224 | 1000 | apache-2.0 | timm |
efficientvit_b1.r256_in1k | 256 | 79.734 | 256 | 1000 | apache-2.0 | timm |
efficientvit_b1.r288_in1k | 288 | 80.322 | 288 | 1000 | apache-2.0 | timm |
efficientvit_b2.r224_in1k | 224 | 82.162 | 224 | 1000 | apache-2.0 | timm |
efficientvit_b2.r256_in1k | 256 | 82.712 | 256 | 1000 | apache-2.0 | timm |
efficientvit_b2.r288_in1k | 288 | 83.078 | 288 | 1000 | apache-2.0 | timm |
efficientvit_b3.r224_in1k | 224 | 83.444 | 224 | 1000 | apache-2.0 | timm |
efficientvit_b3.r256_in1k | 256 | 83.782 | 256 | 1000 | apache-2.0 | timm |
efficientvit_b3.r288_in1k | 288 | 84.162 | 288 | 1000 | apache-2.0 | timm |
efficientvit_l1.r224_in1k | 224 | 84.464 | 224 | 1000 | apache-2.0 | timm |
efficientvit_l2.r224_in1k | 224 | 85.046 | 224 | 1000 | apache-2.0 | timm |
efficientvit_l2.r256_in1k | 256 | 85.380 | 256 | 1000 | apache-2.0 | timm |
efficientvit_l2.r288_in1k | 288 | 85.614 | 288 | 1000 | apache-2.0 | timm |
efficientvit_l2.r384_in1k | 384 | 85.984 | 384 | 1000 | apache-2.0 | timm |
efficientvit_l3.r224_in1k | 224 | 85.810 | 224 | 1000 | apache-2.0 | timm |
efficientvit_l3.r256_in1k | 256 | 85.952 | 256 | 1000 | apache-2.0 | timm |
efficientvit_l3.r320_in1k | 320 | 86.230 | 320 | 1000 | apache-2.0 | timm |
efficientvit_l3.r384_in1k | 384 | 86.396 | 384 | 1000 | apache-2.0 | timm |