timm documentation

Hiera

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Hiera

类别: ViT · 代码: timm/models/hiera.py · 架构: 8 · 预训练权重: 16(其中 8 个包含 ImageNet-1k 结果)

Hiera 是一种分层视觉 Transformer,不包含专用模块(卷积、移位窗口、相对位置偏差),而是依赖掩码自编码器(MAE)预训练来学习空间偏差。

论文

用法

请参阅快速入门了解如何加载预训练权重、进行图像预处理和微调,以及查阅特征提取了解如何将模型用作骨干网络。

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

模型 API 支持

功能Hiera
features_only=True 特征图✓(步长 4、8、16、32)
forward_intermediates()✓
prune_intermediate_layers()✓
任意输入尺寸,无需更改✗
set_input_size()✗
dynamic_img_size=True✗
set_grad_checkpointing()✓
逐层学习率衰减(group_matcher())✓
reset_classifier()✓

✓ 支持,✓ (square) 仅支持方形尺寸,✗ 不支持,– 无需支持(模型本身已接受任意输入尺寸)。通过在每个功能上运行随机初始化的模型(Hiera 使用 hiera_tiny_224,尺寸为 224)进行验证,预期同一类的其他架构表现相同。详情请参阅 Model API 页面。

架构

架构参数(M)GMAC输入大小预训练权重
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 和参数量对应于每种架构的默认输入大小和分类器,数据来自基准测试结果。

预训练权重

Top-1 是 results-imagenet.csv 中在所列评估规模下的 ImageNet-1k 验证准确率,- 表示该权重没有 ImageNet-1k 结果(例如预训练权重或图文权重)。Classes 是预训练分类器的大小,对于没有分类器的权重则为 none。

权重按来源分组:预训练配置中给出的论文或来源,否则为 timm 以外的 Hub 组织,否则为预训练标签的第一部分(architecture.tag)。仅包含单个权重的来源列在 other 下。

mae 标签

权重输入大小Top-1(%)评估大小类许可证Hub
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 标签

权重输入大小Top-1(%)评估大小类许可证Hub
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