Views
No views yet
PedestrianQA: A Benchmark for Vision-Language Models on Pedestrian Intention and Trajectory Prediction
Naman Mishra, Shankar Gangisetty, C. V. Jawahar
1Will the pedestrian located at [x1, y1, x2, y2] in frame 1 cross the road?
2Justify your answer with spatial, temporal, mathematical, ego-vehicle, and scene-context reasoning.
3Conclude the pedestrian's motives.1Given the trajectory of the pedestrian located at [x1, y1, x2, y2]:
2[[x1, y1, x2, y2], ...],
3predict their trajectory for the next N frames.
4Justify your answer with spatial, temporal, mathematical, ego-vehicle, and scene-context reasoning.
5Predict the pedestrian's final destination and conclude their trajectory.Answer: Yes or NoSpatial_ReasonTemporal_ReasonMathematical_ReasonEgo_Vehicle_ReasonScene_Context_ReasonConclusionAnswer: a list of future bounding boxes in [x1, y1, x2, y2] formatSpatial_ReasonTemporal_ReasonMathematical_ReasonEgo_Vehicle_ReasonScene_Context_ReasonFinal_DestinationConclusion1pip install git+https://github.com/huggingface/transformers accelerate
2pip install qwen-vl-utils[decord]1import torch
2from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
3from qwen_vl_utils import process_vision_info
4
5model_id = "namansmishaps/PedestrianQA-All-Qwen2.5-VL-3B-Instruct"
6
7model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
8 model_id,
9 torch_dtype="auto",
10 device_map="auto",
11)
12processor = AutoProcessor.from_pretrained(model_id)
13
14frame_paths = [
15 "file:///path/to/frame_0001.jpg",
16 "file:///path/to/frame_0002.jpg",
17 "file:///path/to/frame_0003.jpg",
18]
19
20prompt = (
21 "Will the pedestrian located at [1103, 908, 1138, 980] in frame 1 cross the road? "
22 "Justify your answer with spatial, temporal, mathematical, ego-vehicle, and "
23 "scene-context reasoning. Conclude the pedestrian's motives."
24)
25
26messages = [
27 {
28 "role": "user",
29 "content": [
30 {"type": "video", "video": frame_paths},
31 {"type": "text", "text": prompt},
32 ],
33 }
34]
35
36text = processor.apply_chat_template(
37 messages,
38 tokenize=False,
39 add_generation_prompt=True,
40)
41image_inputs, video_inputs = process_vision_info(messages)
42inputs = processor(
43 text=[text],
44 images=image_inputs,
45 videos=video_inputs,
46 padding=True,
47 return_tensors="pt",
48).to(model.device)
49
50with torch.no_grad():
51 generated_ids = model.generate(**inputs, max_new_tokens=512)
52
53generated_ids = [
54 out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
55]
56output = processor.batch_decode(
57 generated_ids,
58 skip_special_tokens=True,
59 clean_up_tokenization_spaces=False,
60)[0]
61
62print(output)| Task | Metric | Result |
|---|---|---|
| PIP | Accuracy | 0.783 |
| PIP | F1 | 0.542 |
| PTP | ADE | 37 px |
| PTP | FDE | 68 px |
| Rationale category | Score |
|---|---|
| Spatial Reasoning | 58.36 |
| Temporal Reasoning | 54.84 |
| Mathematical Reasoning | 51.68 |
| Ego-Vehicle Reasoning | 61.51 |
| Scene-Context Reasoning | 59.72 |
| Final Destination Prediction | 32.24 |
| Conclusion | 60.25 |
Qwen/Qwen2.5-VL-3B-Instruct; users must comply with the base model's license and terms.1@inproceedings{mishra2026pedestrianqa,
2 title = {PedestrianQA: A Benchmark for Vision-Language Models on Pedestrian Intention and Trajectory Prediction},
3 author = {Mishra, Naman and Gangisetty, Shankar and Jawahar, C. V.},
4 booktitle = {Proceedings of the IEEE International Conference on Robotics and Automation (ICRA)},
5 year = {2026},
6 url = {https://github.com/botmahn/PedestrianQA}
7}1@article{Qwen2.5-VL,
2 title={Qwen2.5-VL Technical Report},
3 author={Bai, Shuai and Chen, Keqin and Liu, Xuejing and Wang, Jialin and Ge, Wenbin and Song, Sibo and Dang, Kai and Wang, Peng and Wang, Shijie and Tang, Jun and Zhong, Humen and Zhu, Yuanzhi and Yang, Mingkun and Li, Zhaohai and Wan, Jianqiang and Wang, Pengfei and Ding, Wei and Fu, Zheren and Xu, Yiheng and Ye, Jiabo and Zhang, Xi and Xie, Tianbao and Cheng, Zesen and Zhang, Hang and Yang, Zhibo and Xu, Haiyang and Lin, Junyang},
4 journal={arXiv preprint arXiv:2502.13923},
5 year={2025}
6}