标签:
#model-agent-tagged·#NPU·#Ascend·#Ascend-910·#wifi-sensing·#foundation-model本模型卡片已标注
#NPU、#Ascend、#Ascend-910与#model-agent-tagged标签,符合昇腾模型适配比赛提交要求。
Vikkyv9/wifi-view 是 RuView WiFi 感知系列模型
(同源 ruvnet/wifi-densepose-pretrained):WiFi 信道状态信息(CSI)会被人体反射,呼吸、
走动等动作会以微小方式改变信号。本编码器学习从 8 维 CSI 特征向量(Presence / Motion /
Breathing / Heart rate / Phase variance / Person count / Fall detected / RSSI)中提取
128 维 L2 归一化 embedding,作为存在检测、人员识别、生命体征感知等下游任务的共享特征
表示——无需摄像头、可穿墙、隐私友好。
csi-encoder-8-64-128(config.json architecture),2 层全连接对比编码器:
8 维 CSI 特征 -> Linear(8→64) -> BatchNorm1d(64) -> GELU
-> Linear(64→128) -> BatchNorm1d(128) -> L2 normalize -> 128 维 embedding另含 LoRA 适配器(rank 8 / alpha 16,config lora_config)与 presence 检测头
(logit = z @ w + b -> sigmoid)。全量 11,842 参数。
model.safetensors 为自定义 safetensors 格式——header 尾部带 \x00
padding,官方 Rust 解析器报 trailing characters;脚本内置宽容解析(截断到最后一个 })encoder.w1[512] / encoder.w2[8192] 为行优先展平存储,按
model.rvf.jsonl 的 w1_shape[8,64] / w2_shape[64,128] 整形后转置得 Linear 权重;
BN 用 gamma/beta/runMean/runVar 手写 F.batch_norm(..., training=False) 还原 eval 语义lora.A[128,8] / lora.B[8,128] / lora.scaling[1] 随权重交付;主权重
encoder.w1/w2 为完整有效权重(presence 头验证自洽),默认不合并 LoRA(与同源
wifi-densepose 已验证交付一致),encode(use_lora=True) 可显式启用低秩合并torch.npu.is_available() 检测 + torch.npu.set_device,纯 PyTorch 算子
(Linear/BN/GELU/normalize/sigmoid)NPU 直接可跑,无需任何 CUDA 内核--source 支持 JSON 数组或逗号分隔 CSV| 组件 | 版本(实测) |
|---|---|
| Python | 3.11(aarch64) |
| torch | 2.9.0+cpu |
| torch_npu | 2.9.0.post1(CANN 25.5.5) |
| numpy | 最新兼容版本 |
git clone https://gitcode.com/stella4528/wifi-view-npu
cd wifi-view-npu
pip install -r requirements.txtpython3 inference.pypython3 inference.py --device npu
python3 inference.py --device cpu --source "[0.5,0.3,0.2,0.1,0.4,0.5,0.0,-55.0]"
python3 inference.py --device npu --source 0.5,0.3,0.2,0.1,0.4,0.5,0.0,-55.0embedding 形状 (1,128)、范数 1.000000、presence 概率 ~0.9985、
NPU_INFERENCE_PASS=True,结果落盘到 results/(JSON + 证据 + SHA256 + npu-smi)。实测结果见下方;适配脚本与输出截图见
assets/。
norm=1.000000、presence=0.9985、finite_all=True、NPU_INFERENCE_PASS=True)norm=1.000000、presence=0.9985、finite_all=True、NPU_INFERENCE_PASS=True,
与 CPU 结果一致,推理耗时 160.29 ms)| 文件 | 说明 |
|---|---|
inference.py | 昇腾 NPU 推理脚本(含宽容 safetensors 解析 + 权重还原 + 推理/落盘) |
weights/model.safetensors | 原始权重(自定义 safetensors 格式,48,840 B) |
weights/config.json | 模型配置(架构 / 维度 / LoRA 配置) |
requirements.txt | 环境依赖清单 |