xujiashuai/cv_swin-base_patch4_window7_224
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

cv_swin-base_patch4_window7_224 on Ascend NPU

1. 简介

  • 模型来源: microsoft/swin-base-patch4-window7-224-in22k
  • 架构: Swin-Base (patch_size=4, window_size=7, embed_dim=128)
  • 参数量: 86,743,224
  • 任务: 图像分类 (ImageNet-22k 预训练)
  • 适配状态: SUCCESS
  • 适配时间: 2026-05-17

2. 验证环境

组件版本
torch2.9.0
torch-npu2.9.0.post1
CANN8.5.1
NPUAscend 910B4

3. 精度评测

指标数值
Cosine Similarity0.999990
Max Abs Error0.039382
是否满足要求是(< 1%)

4. 性能

指标数值
平均延迟27.08 ms
输出形状[1, 49, 1024]

5. 适配说明

使用 transformers SwinModel.from_pretrained 直接加载预训练权重。输入为随机图像张量 (1, 3, 224, 224),比较 last_hidden_state 输出。

6. 推理输出证据

Model: cv_swin-base_patch4_window7_224
Output shape: [1, 49, 1024]
Latency: 27.08ms
Cosine Similarity: 0.999990
Max Abs Error: 0.039382

7. CPU vs NPU 精度对比

指标CPUNPU差异
Cosine Similarity1.00.9999900.001%
Max Abs Error-0.039382-