namansmishaps commited on
Commit
da7a8db
·
verified ·
1 Parent(s): c9d330c

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +262 -0
README.md ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ base_model:
5
+ - Qwen/Qwen2.5-VL-3B-Instruct
6
+ pipeline_tag: video-text-to-text
7
+ tags:
8
+ - pedestrianqa
9
+ - qwen2.5-vl
10
+ - vision-language
11
+ - video-question-answering
12
+ - autonomous-driving
13
+ - pedestrian-intention-prediction
14
+ - pedestrian-trajectory-prediction
15
+ - rationale-generation
16
+ library_name: transformers
17
+ ---
18
+
19
+ # PedestrianQA Qwen2.5-VL Model
20
+
21
+ This model accompanies the ICRA 2026 paper:
22
+
23
+ > **PedestrianQA: A Benchmark for Vision-Language Models on Pedestrian Intention and Trajectory Prediction**
24
+ > Naman Mishra, Shankar Gangisetty, C. V. Jawahar
25
+
26
+ This model is a PedestrianQA fine-tuned vision-language model based on [Qwen/Qwen2.5-VL-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct). It is trained for pedestrian behavior understanding from ego-vehicle video observations.
27
+
28
+ PedestrianQA formulates pedestrian behavior prediction as multimodal question answering:
29
+
30
+ - **Pedestrian Intention Prediction (PIP):** predict whether the target pedestrian will cross the road.
31
+ - **Pedestrian Trajectory Prediction (PTP):** forecast future target-pedestrian bounding boxes.
32
+ - **Rationale Generation:** explain predictions with spatial, temporal, mathematical, ego-vehicle, and scene-context reasoning.
33
+
34
+ ## Links
35
+
36
+ - Paper: TODO
37
+ - Project webpage: TODO
38
+ - Dataset/code: https://github.com/botmahn/PedestrianQA
39
+ - Model collection: https://huggingface.co/collections/namansmishaps/pedestrianqa
40
+ - Base model: https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct
41
+
42
+ ## Model Details
43
+
44
+ This checkpoint is based on the instruction-tuned 3B Qwen2.5-VL model. Qwen2.5-VL supports image and video-style multimodal inputs and can produce structured text outputs, including coordinates and natural-language explanations.
45
+
46
+ The PedestrianQA fine-tuning adapts the base model to short-horizon pedestrian prediction in structured and unstructured traffic scenes. Training samples contain observation frames centered on a target pedestrian and QA supervision derived from IDD-PeD, JAAD, PIE, and TITAN.
47
+
48
+ ## Intended Use
49
+
50
+ This model is intended for research on:
51
+
52
+ - pedestrian intention prediction,
53
+ - pedestrian trajectory prediction,
54
+ - explainable vision-language models for autonomous driving,
55
+ - video question answering in traffic scenes,
56
+ - rationale generation for safety-critical scene understanding.
57
+
58
+ It is **not** intended for direct use in deployed autonomous driving, ADAS, traffic enforcement, or other safety-critical production systems.
59
+
60
+ ## Input Format
61
+
62
+ The model expects visual observations of an ego-vehicle scene and a text prompt. In the PedestrianQA setup:
63
+
64
+ - JAAD, PIE, and IDD-PeD use 15 observation frames.
65
+ - TITAN uses 10 observation frames.
66
+ - The target pedestrian is identified by their bounding box in the first frame.
67
+
68
+ Example PIP prompt:
69
+
70
+ ```text
71
+ Will the pedestrian located at [x1, y1, x2, y2] in frame 1 cross the road?
72
+ Justify your answer with spatial, temporal, mathematical, ego-vehicle, and scene-context reasoning.
73
+ Conclude the pedestrian's motives.
74
+ ```
75
+
76
+ Example PTP prompt:
77
+
78
+ ```text
79
+ Given the trajectory of the pedestrian located at [x1, y1, x2, y2]:
80
+ [[x1, y1, x2, y2], ...],
81
+ predict their trajectory for the next N frames.
82
+ Justify your answer with spatial, temporal, mathematical, ego-vehicle, and scene-context reasoning.
83
+ Predict the pedestrian's final destination and conclude their trajectory.
84
+ ```
85
+
86
+ ## Output Format
87
+
88
+ For PIP, the model should produce:
89
+
90
+ - `Answer`: `Yes` or `No`
91
+ - `Spatial_Reason`
92
+ - `Temporal_Reason`
93
+ - `Mathematical_Reason`
94
+ - `Ego_Vehicle_Reason`
95
+ - `Scene_Context_Reason`
96
+ - `Conclusion`
97
+
98
+ For PTP, the model should produce:
99
+
100
+ - `Answer`: a list of future bounding boxes in `[x1, y1, x2, y2]` format
101
+ - `Spatial_Reason`
102
+ - `Temporal_Reason`
103
+ - `Mathematical_Reason`
104
+ - `Ego_Vehicle_Reason`
105
+ - `Scene_Context_Reason`
106
+ - `Final_Destination`
107
+ - `Conclusion`
108
+
109
+ ## Usage
110
+
111
+ Install dependencies:
112
+
113
+ ```bash
114
+ pip install git+https://github.com/huggingface/transformers accelerate
115
+ pip install qwen-vl-utils[decord]
116
+ ```
117
+
118
+ Example inference code:
119
+
120
+ ```python
121
+ import torch
122
+ from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
123
+ from qwen_vl_utils import process_vision_info
124
+
125
+ model_id = "namansmishaps/PedestrianQA-TITAN-Qwen2.5-VL-3B-Instruct"
126
+
127
+ model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
128
+ model_id,
129
+ torch_dtype="auto",
130
+ device_map="auto",
131
+ )
132
+ processor = AutoProcessor.from_pretrained(model_id)
133
+
134
+ frame_paths = [
135
+ "file:///path/to/frame_0001.jpg",
136
+ "file:///path/to/frame_0002.jpg",
137
+ "file:///path/to/frame_0003.jpg",
138
+ ]
139
+
140
+ prompt = (
141
+ "Will the pedestrian located at [1103, 908, 1138, 980] in frame 1 cross the road? "
142
+ "Justify your answer with spatial, temporal, mathematical, ego-vehicle, and "
143
+ "scene-context reasoning. Conclude the pedestrian's motives."
144
+ )
145
+
146
+ messages = [
147
+ {
148
+ "role": "user",
149
+ "content": [
150
+ {"type": "video", "video": frame_paths},
151
+ {"type": "text", "text": prompt},
152
+ ],
153
+ }
154
+ ]
155
+
156
+ text = processor.apply_chat_template(
157
+ messages,
158
+ tokenize=False,
159
+ add_generation_prompt=True,
160
+ )
161
+ image_inputs, video_inputs = process_vision_info(messages)
162
+ inputs = processor(
163
+ text=[text],
164
+ images=image_inputs,
165
+ videos=video_inputs,
166
+ padding=True,
167
+ return_tensors="pt",
168
+ ).to(model.device)
169
+
170
+ with torch.no_grad():
171
+ generated_ids = model.generate(**inputs, max_new_tokens=512)
172
+
173
+ generated_ids = [
174
+ out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
175
+ ]
176
+ output = processor.batch_decode(
177
+ generated_ids,
178
+ skip_special_tokens=True,
179
+ clean_up_tokenization_spaces=False,
180
+ )[0]
181
+
182
+ print(output)
183
+ ```
184
+
185
+ Replace the frame paths and target pedestrian box with the sample you want to evaluate.
186
+
187
+ ## Training Data
188
+
189
+ The model is fine-tuned on PedestrianQA, which is derived from four pedestrian datasets:
190
+
191
+ - IDD-PeD
192
+ - JAAD
193
+ - PIE
194
+ - TITAN
195
+
196
+ PedestrianQA contains 10,717 intention QA samples and 3,594 trajectory QA samples. Each sample includes structured rationales grounded in visual motion, pedestrian pose, ego-vehicle behavior, scene context, and geometric trajectory cues.
197
+
198
+ Users must acquire all necessary licenses and permissions for the source datasets before reconstructing or using the corresponding video inputs.
199
+
200
+ ## Evaluation
201
+
202
+ The paper evaluates PedestrianQA models on PIP, PTP, and rationale quality.
203
+
204
+ For the model fine-tuned on all PedestrianQA datasets, the reported overall results are:
205
+
206
+ | Task | Metric | Result |
207
+ | --- | --- | ---: |
208
+ | PIP | Accuracy | 0.783 |
209
+ | PIP | F1 | 0.542 |
210
+ | PTP | ADE | 37 px |
211
+ | PTP | FDE | 68 px |
212
+
213
+ Rationale-generation scores for the same model:
214
+
215
+ | Rationale category | Score |
216
+ | --- | ---: |
217
+ | Spatial Reasoning | 58.36 |
218
+ | Temporal Reasoning | 54.84 |
219
+ | Mathematical Reasoning | 51.68 |
220
+ | Ego-Vehicle Reasoning | 61.51 |
221
+ | Scene-Context Reasoning | 59.72 |
222
+ | Final Destination Prediction | 32.24 |
223
+ | Conclusion | 60.25 |
224
+
225
+ ## Limitations
226
+
227
+ - The model is trained for short-horizon pedestrian behavior prediction and should not be treated as a complete autonomous-driving stack.
228
+ - Predictions may be wrong in rare, occluded, low-visibility, out-of-domain, or distribution-shifted scenarios.
229
+ - Generated rationales can be incomplete or hallucinated, especially when the visual evidence is ambiguous.
230
+ - The model depends on accurate target-pedestrian localization in the prompt.
231
+ - The model should not be used as the sole basis for safety-critical decisions.
232
+
233
+ ## License and Data Terms
234
+
235
+ This model is based on `Qwen/Qwen2.5-VL-3B-Instruct`; users must comply with the base model's license and terms.
236
+
237
+ The fine-tuning data is derived from IDD-PeD, JAAD, PIE, and TITAN. Users must also comply with all upstream dataset licenses and access requirements. Because some source datasets impose non-commercial or access-controlled terms, this model should be treated as a research-use model unless a separate license explicitly states otherwise.
238
+
239
+ ## Citation
240
+
241
+ If you use this model or the PedestrianQA dataset, please cite:
242
+
243
+ ```bibtex
244
+ @inproceedings{mishra2026pedestrianqa,
245
+ title = {PedestrianQA: A Benchmark for Vision-Language Models on Pedestrian Intention and Trajectory Prediction},
246
+ author = {Mishra, Naman and Gangisetty, Shankar and Jawahar, C. V.},
247
+ booktitle = {Proceedings of the IEEE International Conference on Robotics and Automation (ICRA)},
248
+ year = {2026},
249
+ url = {https://github.com/botmahn/PedestrianQA}
250
+ }
251
+ ```
252
+
253
+ Base model:
254
+
255
+ ```bibtex
256
+ @article{Qwen2.5-VL,
257
+ title={Qwen2.5-VL Technical Report},
258
+ 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},
259
+ journal={arXiv preprint arXiv:2502.13923},
260
+ year={2025}
261
+ }
262
+ ```