模型名称: peek 模型链接: https://ai.gitcode.com/hf_mirrors/momentslab/peek 模型描述: PEEK: Picking Essential frames via Efficient Knowledge distillation,基于知识蒸馏的低预算视频帧选择模型,可直接对接下游 Video-Language Model。 模型架构: PeekScorer + MobileCLIP2-S0 参数规模: 约 1.7M(scorer 部分)
| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| 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 ./peek
# 批量输入推理
python inference.py --input_file test_samples.txt --model_path ./peek| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --input | str | - | 输入文本/图像路径 |
| --input_file | str | - | 批量输入文件路径 |
| --model_path | str | peek | 模型路径 |
| --max_length | int | 2048 | 最大生成长度 |
输入:
/tmp/peek-npu-demo/sample.mp4输出:
selected_indices=[1, 3, 4, 6], scores=[-1.279453, -1.207471, -1.188188, -1.044641, -0.987332, -1.073233, -1.125992, -1.236894], elapsed=0.142388s耗时: 0.142s



| 测试样例 | NPU输出 | 耗时 | 是否成功运行 |
|---|---|---|---|
| 样例1:临时样本视频 /tmp/peek-npu-demo/sample.mp4 | selected=[1,3,4,6], scores=[-1.28,-1.21,-1.19,-1.0... | 0.142s | ✅ 成功 |
结论: 模型已在 NPU 上成功运行推理,满足验收要求。 说明: 根据最新规则,不再强制精度1%验证,本章节记录 NPU 运行验证结果。
文档生成时间:2026-08-22 13:14:16