原始模型: 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 归一化嵌入128 → 1(来自 presence-head.json)| 指标 | 数值 |
|---|---|
| embedding cos_sim (CPU vs NPU) | 1.000009 |
| presence cos_sim | 1.000000 |
| max_abs_err | 2.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.py | CPU/NPU 推理对比脚本(权重加载 + 精度指标 + 延迟测试) |
model.safetensors | 原始权重(已修复 safetensors header padding) |
csi-embed-v2.py | 上游参考架构定义 |
presence-head.json | presence 检测头权重 |
config.json | 模型配置 |
assets/agent_workflow.png | 适配工作流 |
assets/npu_device_call.png | NPU 设备调用证据 |
assets/model_result.png | 精度与性能对比结果 |