Skip to content

Questions about Qwen2.5-VL grounding fine-tuning with LLaMA-Factory (dataset format & bbox scaling) #1616

Description

@Rainbow-cocktail

Hi, thanks for your great work on Qwen-VL!

I am currently using LLaMA-Factory to fine-tune Qwen2.5-VL for grounding tasks.
I have read many related issues (e.g. LLaMA-Factory #7015, Qwen-VL #721 and #900, etc.), but some key points still seem unclear. I have two questions and would really appreciate your clarification:

1️⃣ Dataset construction (special tokens)

When building the grounding dataset, do we need to explicitly include the special tokens such as:

<|box_start|> <|box_end|>
<|object_ref_start|> <|object_ref_end|>
# Example:
{
  "messages": [
    {"role":"system","content":"You are a helpful assistant."},
    {"role":"user","content":"找到图像中的<|object_ref_start|>羊<|object_ref_end|>"},
    {"role":"assistant","content":"<|box_start|>(493,169),(539,297)<|box_end|>"}
  ],
  "images": ["mllm_demo_data/person.jpg"]
} 

as mentioned in Issue #7015?
Or does Qwen / LLaMA-Factory automatically insert these tokens when using the proper data format? Or I need to remove these characters

2️⃣ Coordinate / bbox offset after image resizing

During training or inference, the model will typically resize input images internally.

For grounding tasks:

👉 Do we need to manually adjust the bbox coordinates to match the resized image,
or does LLaMA-Factory (or Qwen’s vision processor) automatically handle coordinate scaling?

If we must handle it manually, what is the recommended method?

Option A: Resize the image ourselves to the model’s expected size (e.g., 448/560/672/896 = 28×patch) and scale bbox accordingly

Option B: Convert all bounding boxes to relative 0–1000 format (as Qwen3-VL suggests)

Option C: Other official approach?


Thanks again for your work! Looking forward to your guidance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions