timm documentation

VOLO

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

VOLO

Category: ViT · Code: timm/models/volo.py · Architectures: 11 · Pretrained weights: 11 (11 with ImageNet-1k results)

Vision Outlooker (VOLO) adds outlook attention, which encodes fine-level features from local neighbourhoods, before transformer stages that operate on coarser tokens.

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

Model API support

FeatureVOLO
features_only=True feature maps✓ (strides 16, 16, 16)
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 (VOLO with volo_d1_224 at 224), other architectures of the same class are expected to behave the same. See the Model API page for details.

Architectures

ArchitectureParams (M)GMACsInput sizePretrained weights
volo_d1_22426.636.942241
volo_d1_38426.7822.753841
volo_d2_22458.6814.342241
volo_d2_38458.8746.173841
volo_d3_22486.3320.782241
volo_d3_44886.6396.334481
volo_d4_224192.9644.342241
volo_d4_448193.41197.134481
volo_d5_224295.4672.402241
volo_d5_448295.91315.064481
volo_d5_512296.09425.095121

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
volo_d1_224.sail_in1k22484.1482241000apache-2.0timm
volo_d1_384.sail_in1k38485.2623841000apache-2.0timm
volo_d2_224.sail_in1k22485.2042241000apache-2.0timm
volo_d2_384.sail_in1k38486.0543841000apache-2.0timm
volo_d3_224.sail_in1k22485.4402241000apache-2.0timm
volo_d3_448.sail_in1k44886.5144481000apache-2.0timm
volo_d4_224.sail_in1k22485.8682241000apache-2.0timm
volo_d4_448.sail_in1k44886.7884481000apache-2.0timm
volo_d5_224.sail_in1k22486.0762241000apache-2.0timm
volo_d5_448.sail_in1k44886.9744481000apache-2.0timm
volo_d5_512.sail_in1k51287.0685121000apache-2.0timm
Update on GitHub