HORnet learns to select a subset of frames from videos that maximize downstream task performance. The system consists of:
The following snippet shows how to initialize the HORnet policy with a VLM. Note that this requires the
VisionGRPOPolicy class from the
official repository.
1import torch
2from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
3
4# Load VLM (e.g., Qwen3-VL)
5qwen_model = Qwen2VLForConditionalGeneration.from_pretrained(
6 "Qwen/Qwen3-VL-2B-Instruct",
7 torch_dtype=torch.bfloat16,
8 device_map="auto"
9)
10qwen_processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-2B-Instruct")
11
12# Load HORnet frame selector
13from model import VisionGRPOPolicy
14
15model = VisionGRPOPolicy(
16 encoder_name=None, # Uses TimeSformer
17 feat_dim=768,
18 action_dim=1,
19 qwen_model=qwen_model,
20 qwen_processor=qwen_processor
21).to("cuda")
22
23# Load checkpoint
24checkpoint = torch.load("checkpoints/long/checkpoint-0.1500.pt", map_location="cpu")
25model.load_state_dict(checkpoint, strict=False)
26model.eval()
HORnet was trained on a combination of three video QA datasets, totaling 341,877 QA pairs across 17,350 videos:
1@article{bai2026hornet,
2 title={HORNet: Task-Guided Frame Selection for Video Question Answering with Vision-Language Models},
3 author={Xiangyu Bai*, Bishoy Galoaa*, and Sarah Ostadabbas},
4 journal={arXiv preprint arXiv:2603.18850},
5 year={2026}
6}