This model uses data synthesis techniques and publicly available models to reproduce the work described in SpatialVLM to enhance the spatial reasoning of multimodal models.
With a pipeline of expert models, we can infer spatial relationships between objects in a scene to create a VQA dataset for spatial reasoning.
Running SpaceQwen2.5-VL-3B-Instruct
Ollama
To launch with ollama, run:
ollama run hf.co/remyxai/SpaceQwen2.5-VL-3B-Instruct:latest
Transformers
Install qwen dependencies:
pip install qwen-vl-utils[decord]==0.0.8
To run inference on a sample image:
python
1from transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, AutoProcessor
2from qwen_vl_utils import process_vision_info
34model = Qwen2_5_VLForConditionalGeneration.from_pretrained(5"remyxai/SpaceQwen2.5-VL-3B-Instruct", torch_dtype="auto", device_map="auto"6)7processor = AutoProcessor.from_pretrained("remyxai/SpaceQwen2.5-VL-3B-Instruct")89messages =[10{11"role":"user",12"content":[13{14"type":"image",15"image":"https://raw.githubusercontent.com/remyxai/VQASynth/refs/heads/main/assets/warehouse_sample_2.jpeg",16},17{"type":"text","text":"What is the height of the man in the red hat in feet?"},18],19}20]2122# Preparation for inference23text = processor.apply_chat_template(24 messages, tokenize=False, add_generation_prompt=True25)26image_inputs, video_inputs = process_vision_info(messages)27inputs = processor(28 text=[text],29 images=image_inputs,30 videos=video_inputs,31 padding=True,32 return_tensors="pt",33)34inputs = inputs.to("cuda")3536# Inference: Generation of the output37generated_ids = model.generate(**inputs, max_new_tokens=128)38generated_ids_trimmed =[39 out_ids[len(in_ids):]for in_ids, out_ids inzip(inputs.input_ids, generated_ids)40]41output_text = processor.batch_decode(42 generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False43)44print(output_text)
GGUF
Or run SpaceQwen2.5-VL-3B-Instruct using llama.cpp:
bash
1./llama-qwen2vl-cli -m /path/to/SpaceQwen2.5-VL-3B-Instruct/SpaceQwen2.5-VL-3B-Instruct-F16.gguf \2 --mmproj /path/to/SpaceQwen2.5-VL-3B-Instruct/spaceqwen2.5-vl-3b-instruct-vision.gguf \3 -p "What's the height of the man in the red hat?"\4 --image /path/to/warehouse_sample_2.jpeg --threads 24 -ngl 99
SpaceQwen shines in the 3D positional relations categories of the SpatialScore-Hard comparison featured in the table below:
image/png
Read more about the comprehensive spatial reasoning benchmark: SpatialScore.
The following chart compares performance between SpaceQwen and SpaceThinker on the SpatialScore benchmarks sources.
SpaceQwen_v_SpaceThinker
OmniSpatial
OmniSpatial is another comprehensive spatial reasoning benchmark that assesses dynamic reasoning, complex spatial logic, spatial interaction, and perspective-taking capabilities.
ℹ️ Note: Scores for SpaceQwen, SpaceThinker, SpaceOm are generated via gpt_eval_score on single-choice (*-single) versions of the SpaCE-10 benchmark tasks. Other entries reflect leaderboard accuracy scores from the official SpaCE-10 evaluation table.
Performance may degrade in cluttered environments or camera perspective.
This model was fine-tuned using synthetic reasoning over an internet image dataset.
Multimodal biases inherent to the base model (Qwen2.5-VL) may persist.
Not intended for use in safety-critical or legal decision-making.
Users are encouraged to evaluate outputs critically and consider fine-tuning for domain-specific safety and performance.
Citation
@article{chen2024spatialvlm,
title = {SpatialVLM: Endowing Vision-Language Models with Spatial Reasoning Capabilities},
author = {Chen, Boyuan and Xu, Zhuo and Kirmani, Sean and Ichter, Brian and Driess, Danny and Florence, Pete and Sadigh, Dorsa and Guibas, Leonidas and Xia, Fei},
journal = {arXiv preprint arXiv:2401.12168},
year = {2024},
url = {https://arxiv.org/abs/2401.12168},
}
@misc{qwen2.5-VL,
title = {Qwen2.5-VL},
url = {https://qwenlm.github.io/blog/qwen2.5-vl/},
author = {Qwen Team},
month = {January},
year = {2025}
}
@article{wu2025spatialscore,
author = {Wu, Haoning and Huang, Xiao and Chen, Yaohui and Zhang, Ya and Wang, Yanfeng and Xie, Weidi},
title = {SpatialScore: Towards Unified Evaluation for Multimodal Spatial Understanding},
journal = {arXiv preprint arXiv:2505.17012},
year = {2025},
}
@article{omnispatial25,
title = {OmniSpatial: Towards Comprehensive Spatial Reasoning Benchmark for Vision Language Models},
author = {Mengdi Jia and Zekun Qi and Shaochen Zhang and Wenyao Zhang and Xinqiang Yu and Jiawei He and He Wang and Li Yi},
journal = {arXiv preprint arXiv:2506.03135},
year = {2025}
}
@article{song2025siribench,
title = {{SIRI-Bench}: Challenging VLMs’ Spatial Intelligence through Complex Reasoning Tasks},
author = {Song, Zijian and Lin, Xiaoxin and Huang, Qiuming and Wang, Guangrun and Lin, Liang},
journal = {arXiv preprint arXiv:2506.14512},
year = {2025},
url = {https://arxiv.org/abs/2506.14512}
}
@misc{yin2025spatial,
title = {Spatial Mental Modeling from Limited Views},
author = {Baiqiao Yin and Qineng Wang and Pingyue Zhang and Jianshu Zhang
and Kangrui Wang and Zihan Wang and Jieyu Zhang
and Keshigeyan Chandrasegaran and Han Liu and Ranjay Krishna
and Saining Xie and Manling Li and Jiajun Wu and Li Fei-Fei},
year = {2025},
archivePrefix= {arXiv},
eprint = {2506.21458},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2506.21458}
}