aarongid/wifi-densepose-pretrained 是 RuView WiFi Sensing 的 CSI 嵌入模型,将 8 维 WiFi 信道状态信息 (CSI) 特征映射为 128 维 L2 归一化嵌入,用于 presence 检测、活动识别、呼吸/心率等感知任务。架构为 8 -> Linear(64) + BN + GELU -> Linear(128) + BN -> L2Normalize,参数量仅 9,280,权重仅 39KB (safetensors) / 4.56KB (int4)。
sona-lora (csi-encoder-8-64-128)csi-embed-v2.safetensors (39KB, SHA256 3b37bca66e6050c50ccbc0f6e0501824f258bfdd8675dc0f4541b1e2e96feecd)model-q4.bin 8KB (4-bit), model-q2.bin 4KB, model-q8.bin 16KB[B,8] 标准化 CSI 特征 (presence, motion, breathing, heart, phase_var, person_count, fall, rssi)[B,128] L2 归一化嵌入GitHub: https://github.com/ruvnet/RuView | HuggingFace: https://huggingface.co/aarongid/wifi-densepose-pretrained
npu:0HF_ENDPOINT=https://hf-mirror.com via snapshot_download(repo_id='aarongid/wifi-densepose-pretrained')pip install -r requirements.txt
# requirements.txt:
# torch==2.9.0
# torch_npu==2.9.0.post1
# safetensors>=0.4.0
# numpy>=1.24# 方式1: 默认 (自动寻找权重, 若无则从 hf-mirror 下载)
python inference.py
# 方式2: 指定权重路径
python inference.py --weight ./model_cache/wifi-densepose-pretrained/csi-embed-v2.safetensors --device npu:0
# 方式3: 验证模式 (返回码标识一致性)
python inference.py --mode validate以下为本次在 npu:0 上的真实输出 (固定输入, seed=0, float32):
Model: aarongid/wifi-densepose-pretrained
Task: wifi-sensing / csi-embedding (8-dim -> 128-dim L2)
Architecture: Enc(8->64->128) BatchNorm+GELU
Weight: model_cache/wifi-densepose-pretrained/csi-embed-v2.safetensors exists=True
Loading backend: safetensors + torch
Dtype: float32
Input contract: [B,8] standardized CSI features, B=3
Sample input[0]: [0.1, 0.05, 0.02, 0.01, 0.3, 0.0, 0.0, -0.45]
Sample input[1]: [0.8, 0.6, 0.4, 0.2, 1.2, 1.0, 0.0, -0.35]
CPU output shape: (3, 128)
CPU output[0][:5]: [0.14886702597141266, -0.03988882526755333, -0.08647223562002182, -0.1151958778500557, -0.06391243636608124]
CPU L2 norms: [0.99999994, 0.99999994, 1.0]
NPU available: True device_name=Ascend910_9362
NPU output shape: (3, 128)
NPU output[0][:5]: [0.14884702861309052, -0.039881035685539246, -0.08646204322576523, -0.11518289893865585, -0.06390015035867691]
NPU L2 norms: [1.0, 1.0, 1.0]
Triplet distances: d(anchor,pos)=0.2559 d(anchor,neg)=0.8479 -> PASS
Final: PASS on npu:0[B,8] float32, B=3 固定样本 (still / moving / breathing)[B,128] float32, L2 归一化 (norm≈1.0)在相同输入下对比 CPU 与 npu:0 输出:
CPU-NPU max_abs_diff: 0.000300
CPU-NPU mean_abs_diff: 0.000017
CPU-NPU cosine_sim (mean): 1.000000
Consistency check: PASS (threshold max_abs<1e-3, cos>0.999)torch.npu.is_available()=True, torch.npu.get_device_name(0)=Ascend910_9362, 参数位于 npu:0, dtype float32同步计时 (torch.npu.synchronize() 前后), warmup 3 次, 正式 50 次, batch=3, dtype=float32:
Benchmark: device=npu:0 warmup=3 iters=50 batch=3 dtype=float32
Avg latency: 0.2446 ms (batch 3) // 单次约 0.25 ms, 单样本约 0.08 ms
Throughput: 12262.94 samples/s (1569655.94 dim/s)三张证据图由 scripts/render_xterm_evidence.mjs --style raw 从真实日志渲染:
assets/agent_workflow.png - 下载、侦察、NPU 推理、验证、性能完整工作流assets/npu_device_call.png - npu-smi info + torch.npu.is_available() + 设备名 + 参数 deviceassets/model_result.png - python inference.py 完整输出与 PASSnode-1.json/node-2.json)csi-embed-v2.safetensorsnpu:0 验证, 多卡未测试model.safetensors 头部含填充零, 需用 safe_open 而非 load_file 直接加载Hardware: NPU, NPU, Ascend, Ascend910, wifi-sensing, csi-embedding, feature-extraction