基于 ruv/ruview 模型适配昇腾 NPU 的服务化推理部署方案。
# 克隆仓库
git clone https://gitcode.com/hf_mirrors/ruv/ruview.git
cd ruview
# 或使用 huggingface 下载
pip install huggingface_hub -i https://mirrors.aliyun.com/pypi/simple/
huggingface-cli download ruv/ruview --local-dir ./pip install torch torch_npu numpy onnxruntime -i https://mirrors.aliyun.com/pypi/simple/# CPU 推理
python inference.py --model wiflow-v1.json --device cpu
# NPU 推理
python inference.py --model wiflow-v1.json --device npu
# 使用自定义输入
python inference.py --model wiflow-v1.json --device npu --input csi_features.npy# 启动 vLLM 服务
python -m vllm.entrypoints.openai.api_server \
--model ruv/ruview \
--device npu \
--port 8000 \
--trust-remote-codecurl http://localhost:8000/v1/completions \
-H "Content-Type: application/json" \
-d '{
"model": "ruv/ruview",
"prompt": "wifi_sensing_inference"
}'模型接受 35 维 CSI (Channel State Information) 特征,时间步长为 20:
(35, 20) 或 (batch, 35, 20)import numpy as np
# 随机 CSI 特征 (demo)
csi_features = np.random.randn(35, 20).astype(np.float32)
# 或从文件加载
csi_features = np.load('csi_recording.npy')模型输出 17 个 COCO 格式关键点坐标:
(17, 2) - 17 个关键点,每个包含 (x, y){
"keypoints": [
[0.5234, 0.1234],
[0.5123, 0.2345],
...
],
"num_keypoints": 17,
"format": "coco-17"
}| 指标 | 数值 |
|---|---|
| PCK@20 | 92.9% |
| 推理速度 | ~0.008 ms |
| 吞吐量 | 164,183 emb/sec |
| 模型大小 | 974 KB (pose) / 8 KB (4-bit quantized) |
/tmp/models/ 目录Apache-2.0