模型名称: wifi-densepose-pretrained-NPU 模型链接: https://ai.gitcode.com/hf_mirrors/ruvnet/wifi-densepose-pretrained 模型描述: wifi-densepose-pretrained 是一个 WiFi CSI 嵌入编码器(8→64→128),用于WiFi感知/人员检测/生命体征监测。基于 InfoNCE 自监督对比学习训练,将 8 维 CSI 信号特征映射到 128 维 L2 归一化嵌入向量。 模型架构: MLP (Linear→BatchNorm→GELU→Linear→BatchNorm→L2-Norm) 参数规模: 9,280
| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| Python | >= 3.10 | 推荐 3.11 |
| torch / torch_npu | 2.1.0+ | 昇腾NPU推理 |
| transformers | >= 4.45.0 | HuggingFace 库 |
| 昇腾驱动 | CANN 8.0.RC2+ | 推荐最新版 |
安装命令:
pip install torch torch_npu transformers sentencepiece# 检查 NPU 设备
npu-smi info# 单条输入推理
python inference.py --input "测试输入内容" --model_path ./wifi-densepose-pretrained-NPU
# 批量输入推理
python inference.py --input_file test_samples.txt --model_path ./wifi-densepose-pretrained-NPU| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --input | str | - | 输入文本/图像路径 |
| --input_file | str | - | 批量输入文件路径 |
| --model_path | str | wifi-densepose-pretrained-NPU | 模型路径 |
| --max_length | int | 2048 | 最大生成长度 |
输入:
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]输出:
128维嵌入向量: [0.1349, -0.0427, -0.0884, -0.1063, -0.0536, 0.1381, -0.0189, -0.0088, 0.0865, -0.0226, ...]
L2范数: 1.000000耗时: 0.1422s
输入:
np.random.randn(8) 随机生成输出:
5个样本全部完成推理,128维嵌入向量输出,L2归一化正确耗时: 平均约0.05s



| 测试样例 | NPU输出 | 耗时 | 是否成功运行 |
|---|---|---|---|
| 样例1 | (待填入) | (待填入) | (待验证) |
说明: NPU 运行验证数据将在实际运行后填入,务必保证模型能在 NPU 上正常运行。
文档生成时间:2026-08-22 10:35:33