timm documentation

EfficientViM

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v1.0.30).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

EfficientViM

Category: Efficient/Mobile Β· Code: timm/models/efficientvim.py Β· Architectures: 8 Β· Pretrained weights: 12 (0 with ImageNet-1k results)

Efficient Vision Mamba (EfficientViM) is built around the Hidden State Mixer based State Space Duality (HSM-SSD) layer, implemented here in plain PyTorch. The _dist models add a distillation head.

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('efficientvim_m1.e300_in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

Model API support

FeatureEfficientViMEfficientViMDistilled
features_only=True feature mapsβœ“ (strides 16, 32, 64)βœ“ (strides 16, 32, 64)
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 (EfficientViM with efficientvim_m1 at 224, EfficientViMDistilled with efficientvim_m1_dist 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
efficientvim_m1EfficientViM6.68-2242
efficientvim_m1_distEfficientViMDistilled7.64-2241
efficientvim_m2EfficientViM13.90-2242
efficientvim_m2_distEfficientViMDistilled15.32-2241
efficientvim_m3EfficientViM16.60-2242
efficientvim_m3_distEfficientViMDistilled18.18-2241
efficientvim_m4EfficientViM19.61-2562
efficientvim_m4_distEfficientViMDistilled21.18-2561

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
efficientvim_m1.e300_in1k224--1000mittimm
efficientvim_m1.e450_in1k224--1000mittimm
efficientvim_m1_dist.in1k224--1000mittimm
efficientvim_m2.e300_in1k224--1000mittimm
efficientvim_m2.e450_in1k224--1000mittimm
efficientvim_m2_dist.in1k224--1000mittimm
efficientvim_m3.e300_in1k224--1000mittimm
efficientvim_m3.e450_in1k224--1000mittimm
efficientvim_m3_dist.in1k224--1000mittimm
efficientvim_m4.e300_in1k256--1000mittimm
efficientvim_m4.e450_in1k256--1000mittimm
efficientvim_m4_dist.in1k256--1000mittimm
Update on GitHub