cpystan/SD-VLM-7B

Model

1

stars

7

commits

3

linked in READMEs

Dec 15, 2025

updated

llava_llama
safetensors

README

SD-VLM-8B

🌐 Homepage | 🤗 Dataset | 📖 arXiv | GitHub

🎯 The SD-VLM architecture enhances a standard Vision-Language Model (VLM) with 3D spatial awareness through a minimal yet effective modification.

1. Base VLM: Utilizes the LLaVA-1.5-7B framework, consisting of a CLIP-ViT vision encoder, a Vicuna large language model (LLM), and a linear projector connecting them.

2. Depth Encoding Core (DPE): The central innovation is the Depth Positional Encoding (DPE) module. It processes an input depth map (from an external estimator like Depth-Anything-V2) to generate depth-aware embeddings (E_depth). These embeddings are then directly added to the standard image features (E_image) from the vision encoder:

This simple addition injects explicit 3D spatial priors into the model without altering the backbone architecture.

3. Training Approach: The model is efficiently fine-tuned on the MSMU spatial dataset for one epoch using LoRA, keeping the vision encoder frozen. This allows the LLM and projector to learn how to interpret the depth-enhanced visual features for quantitative reasoning.

In essence, SD-VLM's structure is defined by a streamlined integration: it upgrades a standard VLM to understand 3D space by fusing depth information into visual features through a parameter-free additive operation, all trained efficiently on targeted data.

Model Framework

Quick Start!

from llava.model.builder import load_pretrained_model
from llava.mm_utils import get_model_name_from_path
from llava.eval.run_llava import eval_model
from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
import copy

model_path = "cpystan/SD-VLM-7B"

tokenizer, model, image_processor, context_len = load_pretrained_model(
    model_path=model_path,
    model_base=None,
    model_name=get_model_name_from_path(model_path)
)

input_ids = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).cuda()
image = Image.open(os.path.join(image_folder, image_file)).convert('RGB')
ori_img = copy.deepcopy(image)
image_tensor = process_images([image], image_processor, model.config)[0]

with torch.inference_mode():
    output_ids = model.generate(
        input_ids,
        images=image_tensor.unsqueeze(0).half().to(input_ids.device),
        image_sizes=[image.size],
        do_sample=True if temperature > 0 else False,
        temperature=0.2,
        top_p=None,
        num_beams=1,
        ori_imgs = [ori_img],
        max_new_tokens=1024,
        use_cache=True,)
response= tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0].strip()

🏆 Mini-Leaderboard

We show a mini-leaderboard here. It shows the results of each sub-category and the overall performance.

Results on MSMU-Bench

ModelExistenceObject
Counting
Scale
Est.
GroundingRelative
Position
Absolute
Distance
Scale
Comparison
Ref. Object
Est.
Average
Large Language Models (LLMs): Text only
GPT-4-Turbo12.765.2113.5112.6424.847.5036.7912.0415.66
Qwen2.54.250.000.7813.790.620.0016.041.574.63
DeepSeek-V30.005.241.546.9010.560.0025.475.247.39
Vision-Language Models (VLMs): Image + Text
GPT-4o44.6841.673.8627.5967.0820.0054.722.0932.28
Gemini-238.3043.7523.9419.5454.6612.5069.8118.8535.17
Qwen2.5-VL-72B59.5735.421.5413.7957.762.5066.049.9530.82
Qwen2.5-VL-32B29.7941.6710.8118.3960.252.5046.2310.9927.59
Qwen2.5-VL-7B12.764.170.001.151.240.005.660.523.19
Intern-VL3-78B47.6242.716.4726.3256.9413.3364.1016.4633.63
Intern-VL3-8B36.1741.674.6318.3960.252.5049.068.3828.54
LLaVA-1.5-7B1.5436.465.0220.6942.865.0038.680.5219.45
Depth-encoded VLMs: Image + Depth + Text
SpatialBot10.6446.8815.8328.7466.465.0050.948.9029.17
SpatialRGPT10.6436.4620.0817.2460.2515.0062.269.9528.98
SD-VLM-8B87.2347.9251.3542.5375.1640.0055.6646.0756.31

Examples

Citation

BibTeX:

@inproceedings{chen2025sdvlm,
      title={SD-VLM: Spatial Measuring and Understanding with Depth-Encoded Vision-Language Models}, 
      author={Pingyi Chen and Yujing Lou and Shen Cao and Jinhui Guo and Lubin Fan and Yue Wu and Lin Yang and Lizhuang Ma and Jieping Ye},
      booktitle={NeurIPS},
      year={2025},
}

Contributors

cpystan

7 commits

cpystan/SD-VLM-7B

Model

1

stars

7

commits

3

linked in READMEs

Dec 15, 2025

updated

llava_llama
safetensors

README

SD-VLM-8B

🌐 Homepage | 🤗 Dataset | 📖 arXiv | GitHub

🎯 The SD-VLM architecture enhances a standard Vision-Language Model (VLM) with 3D spatial awareness through a minimal yet effective modification.

1. Base VLM: Utilizes the LLaVA-1.5-7B framework, consisting of a CLIP-ViT vision encoder, a Vicuna large language model (LLM), and a linear projector connecting them.

2. Depth Encoding Core (DPE): The central innovation is the Depth Positional Encoding (DPE) module. It processes an input depth map (from an external estimator like Depth-Anything-V2) to generate depth-aware embeddings (E_depth). These embeddings are then directly added to the standard image features (E_image) from the vision encoder:

This simple addition injects explicit 3D spatial priors into the model without altering the backbone architecture.

3. Training Approach: The model is efficiently fine-tuned on the MSMU spatial dataset for one epoch using LoRA, keeping the vision encoder frozen. This allows the LLM and projector to learn how to interpret the depth-enhanced visual features for quantitative reasoning.

In essence, SD-VLM's structure is defined by a streamlined integration: it upgrades a standard VLM to understand 3D space by fusing depth information into visual features through a parameter-free additive operation, all trained efficiently on targeted data.

Model Framework

Quick Start!

from llava.model.builder import load_pretrained_model
from llava.mm_utils import get_model_name_from_path
from llava.eval.run_llava import eval_model
from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
import copy

model_path = "cpystan/SD-VLM-7B"

tokenizer, model, image_processor, context_len = load_pretrained_model(
    model_path=model_path,
    model_base=None,
    model_name=get_model_name_from_path(model_path)
)

input_ids = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).cuda()
image = Image.open(os.path.join(image_folder, image_file)).convert('RGB')
ori_img = copy.deepcopy(image)
image_tensor = process_images([image], image_processor, model.config)[0]

with torch.inference_mode():
    output_ids = model.generate(
        input_ids,
        images=image_tensor.unsqueeze(0).half().to(input_ids.device),
        image_sizes=[image.size],
        do_sample=True if temperature > 0 else False,
        temperature=0.2,
        top_p=None,
        num_beams=1,
        ori_imgs = [ori_img],
        max_new_tokens=1024,
        use_cache=True,)
response= tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0].strip()

🏆 Mini-Leaderboard

We show a mini-leaderboard here. It shows the results of each sub-category and the overall performance.

Results on MSMU-Bench

ModelExistenceObject
Counting
Scale
Est.
GroundingRelative
Position
Absolute
Distance
Scale
Comparison
Ref. Object
Est.
Average
Large Language Models (LLMs): Text only
GPT-4-Turbo12.765.2113.5112.6424.847.5036.7912.0415.66
Qwen2.54.250.000.7813.790.620.0016.041.574.63
DeepSeek-V30.005.241.546.9010.560.0025.475.247.39
Vision-Language Models (VLMs): Image + Text
GPT-4o44.6841.673.8627.5967.0820.0054.722.0932.28
Gemini-238.3043.7523.9419.5454.6612.5069.8118.8535.17
Qwen2.5-VL-72B59.5735.421.5413.7957.762.5066.049.9530.82
Qwen2.5-VL-32B29.7941.6710.8118.3960.252.5046.2310.9927.59
Qwen2.5-VL-7B12.764.170.001.151.240.005.660.523.19
Intern-VL3-78B47.6242.716.4726.3256.9413.3364.1016.4633.63
Intern-VL3-8B36.1741.674.6318.3960.252.5049.068.3828.54
LLaVA-1.5-7B1.5436.465.0220.6942.865.0038.680.5219.45
Depth-encoded VLMs: Image + Depth + Text
SpatialBot10.6446.8815.8328.7466.465.0050.948.9029.17
SpatialRGPT10.6436.4620.0817.2460.2515.0062.269.9528.98
SD-VLM-8B87.2347.9251.3542.5375.1640.0055.6646.0756.31

Examples

Citation

BibTeX:

@inproceedings{chen2025sdvlm,
      title={SD-VLM: Spatial Measuring and Understanding with Depth-Encoded Vision-Language Models}, 
      author={Pingyi Chen and Yujing Lou and Shen Cao and Jinhui Guo and Lubin Fan and Yue Wu and Lin Yang and Lizhuang Ma and Jieping Ye},
      booktitle={NeurIPS},
      year={2025},
}

Contributors

cpystan

7 commits