Model Overview
PEEK (Picking Essential frames via Efficient Knowledge distillation) is a query-free video frame selector for low-budget video captioning. It receives video frame embeddings and predicts per-frame relevance scores, returning the most important frames in temporal order for downstream Video-Language Models.
Validation Environment
| Component | Version |
|---|---|
| OS | Linux (aarch64) |
| Python | 3.11.14 |
| PyTorch | 2.9.0+cpu |
| torch_npu | 2.9.0.post1 |
| CANN | 8.5.1 |
| NPU | Ascend 910B (Ascend910_9362) |
| NPU Count | 2 |
Installation
pip install torch>=2.0 torch-npu numpy safetensors open_clip_torch PillowNPU Inference
python inference.py --model-dir /path/to/model_dir --k 4 --num-frames 20 --device npu:0The script automatically:
Real Inference Results
Test configuration: 20 synthetic frames, k=4 selection, Ascend 910B NPU
NPU Results:
Frame 4 (t=2.0s): score=-0.5395
Frame 5 (t=2.5s): score=-0.4766
Frame 10 (t=5.0s): score=-0.5911
Frame 15 (t=7.5s): score=-0.6969
Performance:
Encode time: 0.095s
Score time: 0.016s
Total inference time: 0.112sCPU-NPU Consistency Verification
| Metric | CPU | NPU | Status |
|---|---|---|---|
| Selected frames | [4, 5, 10, 15] | [4, 5, 10, 15] | MATCH |
| Frame 4 score | -0.5379 | -0.5395 | ~0.3% diff |
| Frame 5 score | -0.4754 | -0.4766 | ~0.3% diff |
| Frame 10 score | -0.5880 | -0.5911 | ~0.5% diff |
| Frame 15 score | -0.6956 | -0.6969 | ~0.2% diff |
Both CPU and NPU produce identical frame selections with negligible score differences (< 0.5%), confirming numerical consistency.
Performance Test
| Metric | Value |
|---|---|
| Model parameters | 1,712,129 |
| Frame encoding (20 frames) | 0.095s |
| Frame scoring | 0.016s |
| Total inference | 0.112s |
| Device | Ascend 910B (npu:0) |
Known Limitations
aten::_transformer_encoder_layer_fwd operator falls back to CPU on NPU backendtimm/MobileCLIP2-S0-OpenCLIP