timm documentation
NaFlex ViT
NaFlex ViT
类别: ViT · 代码: timm/models/naflexvit.py · 架构: 14 · 预训练权重: 11(其中 3 个包含 ImageNet-1k 结果)
一个视觉 Transformer,将 patch 嵌入和位置编码整合在一个模块中,支持具有可变宽高比和分辨率的预分块输入(NaFlex)、FlexiViT 可变 patch 大小以及 NaViT 分解位置嵌入。
论文
- 一张图像值 16x16 个词:用于大规模图像识别的 Transformer
- FlexiViT:适用于所有补丁大小的单一模型
- Patch n’ Pack:NaViT,适用于任意宽高比和分辨率的视觉 Transformer
- SigLIP 2:具有改进的语义理解、定位和密集特征的多语言视觉-语言编码器
由预训练权重引用:
用法
请参阅快速入门了解如何加载预训练权重、进行图像预处理和微调,以及查阅特征提取了解如何将模型用作骨干网络。
>>> import timm
>>> model = timm.create_model('naflexvit_base_patch16_parfac_gap.e300_s576_in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)模型 API 支持
✓ 支持,✓ (square) 仅支持方形尺寸,✗ 不支持,– 无需支持(模型本身已接受任意输入尺寸)。通过在每个功能上运行随机初始化的模型(NaFlexVit 使用 naflexvit_base_patch16_parfac_gap,尺寸为 384)进行验证,预期同一类的其他架构表现相同。详情请参阅 模型 API 页面。
架构
| 架构 | 参数(M) | GMAC | 输入大小 | 预训练权重 |
|---|---|---|---|---|
naflexvit_base_patch16_gap | 86.63 | 55.86 | 384 | 1 |
naflexvit_base_patch16_map | 93.72 | 56.23 | 384 | 0 |
naflexvit_base_patch16_par_gap | 86.63 | 55.86 | 384 | 1 |
naflexvit_base_patch16_parfac_gap | 86.46 | 55.86 | 384 | 1 |
naflexvit_base_patch16_radio_v3 | 98.25 | - | 512 | 1 |
naflexvit_base_patch16_siglip | 92.93 | 56.12 | 384 | 1 |
naflexvit_giant_patch16_radio_v3 | 1159.62 | - | 512 | 1 |
naflexvit_huge_patch16_radio_v3 | 651.64 | - | 512 | 1 |
naflexvit_huge_patch16_radio_v4 | 651.65 | - | 512 | 1 |
naflexvit_large_patch16_radio_v3 | 319.93 | - | 512 | 1 |
naflexvit_so150m2_patch16_reg1_gap | 136.06 | 89.53 | 384 | 0 |
naflexvit_so150m2_patch16_reg1_map | 142.46 | 90.33 | 384 | 0 |
naflexvit_so400m_patch16_radio_v4 | 431.24 | - | 512 | 1 |
naflexvit_so400m_patch16_siglip | 427.89 | 259.65 | 384 | 1 |
GMACs 和参数量对应于每种架构的默认输入大小和分类器,数据来自基准测试结果。
预训练权重
Top-1 是 results-imagenet.csv 中在所列评估规模下的 ImageNet-1k 验证准确率,- 表示该权重没有 ImageNet-1k 结果(例如预训练权重或图文权重)。Classes 是预训练分类器的大小,对于没有分类器的权重则为 none。
权重按来源分组:预训练配置中给出的论文或来源,否则为 timm 以外的 Hub 组织,否则为预训练标签的第一部分(architecture.tag)。仅包含单个权重的来源列在
other 下。
arXiv:2412.07679
预训练配置引用了 arXiv:2412.07679。
| 权重 | 输入大小 | Top-1(%) | 评估大小 | 类 | 许可证 | Hub |
|---|---|---|---|---|---|---|
naflexvit_base_patch16_radio_v3.c_radio | 512 | - | - | none | nvidia-open-model-license | timm |
naflexvit_giant_patch16_radio_v3.c_radio | 512 | - | - | none | nvidia-open-model-license | timm |
naflexvit_huge_patch16_radio_v3.c_radio | 512 | - | - | none | nvidia-open-model-license | timm |
naflexvit_large_patch16_radio_v3.c_radio | 512 | - | - | none | nvidia-open-model-license | timm |
v2 标签
| 权重 | 输入大小 | Top-1(%) | 评估大小 | 类 | 许可证 | Hub |
|---|---|---|---|---|---|---|
naflexvit_base_patch16_siglip.v2_webli | 384 | - | - | none | apache-2.0 | timm |
naflexvit_so400m_patch16_siglip.v2_webli | 384 | - | - | none | apache-2.0 | timm |
arXiv:2601.17237
预训练配置引用了 arXiv:2601.17237。
| 权重 | 输入大小 | Top-1(%) | 评估大小 | 类 | 许可证 | Hub |
|---|---|---|---|---|---|---|
naflexvit_huge_patch16_radio_v4.c_radio | 512 | - | - | none | nvidia-open-model-license | timm |
naflexvit_so400m_patch16_radio_v4.c_radio | 512 | - | - | none | nvidia-open-model-license | timm |
其他
| 权重 | 输入大小 | Top-1(%) | 评估大小 | 类 | 许可证 | Hub |
|---|---|---|---|---|---|---|
naflexvit_base_patch16_gap.e300_s576_in1k | 384 | 83.340 | 384 | 1000 | apache-2.0 | timm |
naflexvit_base_patch16_par_gap.e300_s576_in1k | 384 | 83.508 | 384 | 1000 | apache-2.0 | timm |
naflexvit_base_patch16_parfac_gap.e300_s576_in1k | 384 | 83.468 | 384 | 1000 | apache-2.0 | timm |