timm documentation

Hiera

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

Hiera

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

Hiera is a hierarchical vision transformer without specialized modules (convolutions, shifted windows, relative position biases), relying on masked autoencoder (MAE) pretraining to learn spatial biases.

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

Model API support

FeatureHiera
features_only=True feature maps✓ (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 (Hiera with hiera_tiny_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
hiera_base_22451.529.402242
hiera_base_abswin_25651.2712.462560
hiera_base_plus_22469.9012.672242
hiera_huge_224672.78124.852242
hiera_large_224213.7440.342242
hiera_small_22435.016.422242
hiera_small_abswin_25634.368.292564
hiera_tiny_22427.914.912242

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.

Weights are grouped by source: the paper or origin given in the pretrained config, else a Hub organization other than timm, else the first part of the pretrained tag (architecture.tag). Sources with a single weight are listed under other.

mae tags

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
hiera_base_224.mae224--nonecc-by-nc-4.0timm
hiera_base_224.mae_in1k_ft_in1k22484.5282241000cc-by-nc-4.0timm
hiera_base_plus_224.mae224--nonecc-by-nc-4.0timm
hiera_base_plus_224.mae_in1k_ft_in1k22485.1362241000cc-by-nc-4.0timm
hiera_huge_224.mae224--nonecc-by-nc-4.0timm
hiera_huge_224.mae_in1k_ft_in1k22486.8402241000cc-by-nc-4.0timm
hiera_large_224.mae224--nonecc-by-nc-4.0timm
hiera_large_224.mae_in1k_ft_in1k22486.0462241000cc-by-nc-4.0timm
hiera_small_224.mae224--nonecc-by-nc-4.0timm
hiera_small_224.mae_in1k_ft_in1k22483.8882241000cc-by-nc-4.0timm
hiera_tiny_224.mae224--nonecc-by-nc-4.0timm
hiera_tiny_224.mae_in1k_ft_in1k22482.8262241000cc-by-nc-4.0timm

sbb2 tags

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
hiera_small_abswin_256.sbb2_e200_in12k256--11821apache-2.0timm
hiera_small_abswin_256.sbb2_e200_in12k_ft_in1k25684.9122561000apache-2.0timm
hiera_small_abswin_256.sbb2_pd_e200_in12k256--11821apache-2.0timm
hiera_small_abswin_256.sbb2_pd_e200_in12k_ft_in1k25684.5642561000apache-2.0timm
Update on GitHub