w
weasonlee/agh-wifi-densepose-pretrained
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

aarongid/wifi-densepose-pretrained (csi-embed-v2) — Ascend NPU 适配

原始模型: https://huggingface.co/aarongid/wifi-densepose-pretrained(镜像: https://ai.gitcode.com/hf_mirrors/aarongid/wifi-densepose-pretrained)

模型说明

ESP32 WiFi CSI(信道状态信息)对比学习编码器 csi-embed-v2:

  • 架构: 8 → 64 → 128(Linear + BatchNorm1d + GELU),输出 L2 归一化嵌入
  • presence 检测头: 128 → 1(来自 presence-head.json)
  • 参数量: 11,842(48KB safetensors,扁平键名布局,本仓库已做键名重映射与矩阵 reshape)
  • 任务: WiFi CSI 特征嵌入 / 房间人体存在检测

NPU 适配结果(Ascend 910)

指标数值
embedding cos_sim (CPU vs NPU)1.000009
presence cos_sim1.000000
max_abs_err2.118e-05
符号一致率100.00%
CPU 延迟3.575 ms/iter (batch=4096)
NPU 延迟0.233 ms/iter
加速比15.37x

环境: Python 3.11.14 / torch 2.9.0+cpu / torch_npu 2.9.0.post1 / CANN 8.5.1 / Ascend 910 ×2

使用方式

pip install -r requirements.txt
python inference.py

自动检测 torch_npu:有 NPU 则输出 CPU vs NPU 对比,无则 CPU-only。

文件说明

文件说明
inference.pyCPU/NPU 推理对比脚本(权重加载 + 精度指标 + 延迟测试)
model.safetensors原始权重(已修复 safetensors header padding)
csi-embed-v2.py上游参考架构定义
presence-head.jsonpresence 检测头权重
config.json模型配置
assets/agent_workflow.png适配工作流
assets/npu_device_call.pngNPU 设备调用证据
assets/model_result.png精度与性能对比结果