凤
weixin_44093752/WiFi-DensePose-Ascend-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

ruvnet/wifi-densepose-pretrained Ascend NPU 适配

本仓对应官方 Hugging Face 模型 ruvnet/wifi-densepose-pretrained。Google 与官方 Hugging Face 页面于 2026-08-22 核实:仓库约 186 kB,许可证 MIT;v2 编码器为 8→64→128 的 PyTorch 网络,官方说明参数量 9,280,权重为 csi-embed-v2.safetensors。

适配内容

  • 按官方 csi-embed-v2.py 重现 Enc 结构,使用 safetensors.torch.load_file 严格加载 csi-embed-v2.safetensors。
  • inference.py 支持 cpu、npu 和 auto;显式指定 NPU 不可用时直接失败。
  • 固定随机种子,使用同一批 [16,8] 标准化 CSI 特征,输出 [16,128] L2 embedding。
  • 不包含原始权重,运行时通过 --model-path 指定本地模型目录或权重文件,避免仓库膨胀。

真实 Ascend910 验证

指标CPUNPU (Ascend910 npu:0)
模型加载0.0022 s0.0162 s
单次推理0.0017 s0.1489 s
输出 shape[16,128][16,128]
输出 dtypefloat32float32
全有限值truetrue

同一输入 CPU/NPU 对拍:余弦相似度 0.9999998212,最大绝对误差 0.0003144741,平均绝对误差 0.0000115235,precision_pass=true。权重文件大小 39,672 字节,SHA-256 为 183c988b918abad3cd7ae50af0fe1be9196d0353055ac6865345be2f7fdaed72。

证据

Model Agent CPU/NPU 推理工作流

Model Agent CPU/NPU 推理工作流

Ascend NPU 设备调用

Ascend NPU 设备调用

CPU/NPU 精度验证结果

CPU/NPU 精度验证结果

运行

模型目录需包含 csi-embed-v2.safetensors。在已加载 CANN 环境的 Ascend 容器内执行:

python inference.py --model-path /tmp/model-agent/wifi70 --device npu --batch-size 16

依赖见 requirements.txt。原始模型:ruvnet/wifi-densepose-pretrained。