timm documentation
HieraDet(SAM 2)
快速入门
教程
模型页面
模型系列结果
卷积网络
视觉 Transformer
BEiTCaiTConViTCrossViTDaViTDeiTEVAGCViTHieraHieraDet(SAM 2)MViTv2NaFlex ViTNesTPiTPVTv2Segment Anything ViTSwin TransformerSwin Transformer V2Swin Transformer V2 (CR)TNT双胞胎视觉 Transformer(相对位置)视觉 Transformer (ViT)VOLOXCiT
混合卷积 / 注意力网络
高效与移动网络
MLP 及其他 token 混合器
多模态模型的视觉编码器
参考
You are viewing main version, which requires installation from source. If you'd like
regular pip install, checkout the latest stable version (v1.0.31).
HieraDet(SAM 2)
类别: ViT · 代码: timm/models/hieradet_sam2.py · 架构: 5 · 预训练权重: 8(0 个具有 ImageNet-1k 结果)
HieraDet 是 Segment Anything 2 (SAM 2) 中基于 Hiera 的图像编码器,采用窗口注意力机制和窗口位置嵌入。
论文
用法
请参阅快速入门了解如何加载预训练权重、进行图像预处理和微调,以及查阅特征提取了解如何将模型用作骨干网络。
>>> import timm
>>> model = timm.create_model('sam2_hiera_base_plus.fb_r896', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)模型 API 支持
✓ 支持,✓ (square) 仅支持方形尺寸,✗ 不支持,– 无需支持(模型本身已接受任意输入尺寸)。通过在每个功能上运行随机初始化的模型(HieraDet 使用 sam2_hiera_tiny,尺寸为 256)进行验证,预期同一类的其他架构表现相同。详情请参阅 Model API 页面。
架构
| 架构 | 参数(M) | GMAC | 输入大小 | 预训练权重 |
|---|---|---|---|---|
hieradet_small | 34.73 | 8.51 | 256 | 0 |
sam2_hiera_base_plus | 68.68 | 227.48 | 896 | 2 |
sam2_hiera_large | 212.15 | 907.48 | 1024 | 2 |
sam2_hiera_small | 33.95 | 123.99 | 896 | 2 |
sam2_hiera_tiny | 26.85 | 99.86 | 896 | 2 |
GMACs 和参数量对应于每种架构的默认输入大小和分类器,数据来自基准测试结果。
预训练权重
Top-1 是 results-imagenet.csv 中在所列评估规模下的 ImageNet-1k 验证准确率,- 表示该权重没有 ImageNet-1k 结果(例如预训练权重或图文权重)。Classes 是预训练分类器的大小,对于没有分类器的权重则为 none。
| 权重 | 输入大小 | Top-1(%) | 评估大小 | 类 | 许可证 | Hub |
|---|---|---|---|---|---|---|
sam2_hiera_base_plus.fb_r896 | 896 | - | - | none | apache-2.0 | timm |
sam2_hiera_base_plus.fb_r896_2pt1 | 896 | - | - | none | apache-2.0 | timm |
sam2_hiera_large.fb_r1024 | 1024 | - | - | none | apache-2.0 | timm |
sam2_hiera_large.fb_r1024_2pt1 | 1024 | - | - | none | apache-2.0 | timm |
sam2_hiera_small.fb_r896 | 896 | - | - | none | apache-2.0 | timm |
sam2_hiera_small.fb_r896_2pt1 | 896 | - | - | none | apache-2.0 | timm |
sam2_hiera_tiny.fb_r896 | 896 | - | - | none | apache-2.0 | timm |
sam2_hiera_tiny.fb_r896_2pt1 | 896 | - | - | none | apache-2.0 | timm |