xujiashuai/timm-swinv2_tiny_window8_256.ms_in1k
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

timm/swinv2_tiny_window8_256.ms_in1k - Ascend NPU Adaptation

1. Model Overview

SwinV2 Tiny is a hierarchical Vision Transformer using shifted windows with window size 8, trained on ImageNet-1k at 256x256 resolution.

  • Original: timm/swinv2_tiny_window8_256.ms_in1k
  • Architecture: SwinV2 Transformer
  • Parameters: 28,347,154
  • Input Resolution: 256x256
  • Output Classes: 1000

2. NPU Adaptation

  • Device: Ascend NPU (npu:0)
  • Framework: PyTorch + torch_npu

3. Accuracy

MetricValue
Cosine Similarity0.999986
Max Abs Error0.002450

4. Latency

DeviceAvg Latency
NPU (npu:0)12.51 ms

5. CPU vs NPU

MetricCPUNPU
Output Shape[1, 1000][1, 1000]
Prediction852852

6. Usage

source setup_env.sh
HF_ENDPOINT=https://hf-mirror.com python3 inference.py --device npu:0