Views
No views yet
1git clone https://github.com/xiaomi-research/spatio-lm.git
2cd spatio-lm
3pip install -e .1import torch
2from lmms_eval.models.simple.internvl2 import load_image
3from PIL import Image
4from transformers import AutoTokenizer
5
6from spatiolm.models import InternVL3RChatModel
7
8checkpoint = "xiaomi-research/SpatioLM-Understanding-SenseNovaSI"
9image = Image.open("/path/to/image.jpg").convert("RGB")
10
11model = InternVL3RChatModel.from_pretrained(
12 checkpoint,
13 dtype=torch.bfloat16,
14 low_cpu_mem_usage=True,
15).eval().cuda()
16tokenizer = AutoTokenizer.from_pretrained(
17 checkpoint,
18 trust_remote_code=True,
19 use_fast=False,
20)
21pixel_values = load_image(image, input_size=448).to(
22 device="cuda",
23 dtype=torch.bfloat16,
24)
25answer = model.chat(
26 tokenizer,
27 pixel_values,
28 "Which object is closer to the camera?",
29 {"max_new_tokens": 128, "do_sample": False},
30)
31print(answer)1@inproceedings{wu2026spatiolm,
2 title={SpatioLM: Towards General Physical Spatial Intelligence in Vision-Language Models},
3 author={Wu, Jing and Wu, Jianhua and Guan, Jiayi and Chen, Jiahong and Lu, Jinghui and Ye, Hangjun and Gao, Bingzhao and Chen, Long},
4 booktitle={International Conference on Machine Learning (ICML)},
5 year={2026},
6 note={To appear},
7 eprint={2608.01899},
8 archivePrefix={arXiv},
9 url={https://arxiv.org/abs/2608.01899}
10}