Skip to content

feat: 🚀 from_vlm deepseek vl 2 support #1884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

onuralpszr
Copy link
Contributor

@onuralpszr onuralpszr commented Jul 11, 2025

Description

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How has this change been tested, please provide a testcase or example of how you tested the change?

The code changes in this PR was tested primarily with the following colab:

Colab

The code can also be tested with the following simple script with a result formatted like DeepSeek-VL2's response:

# wget https://huggingface.co/spaces/deepseek-ai/deepseek-vl2-small/resolve/main/images/visual_grounding_1.jpeg

from PIL import Image
import supervision as sv


image = Image.open("visual_grounding_1.jpeg")
result = "<|ref|>The giraffe at the back<|/ref|><|det|>[[580, 270, 999, 904]]<|/det|><|ref|>The giraffe at the front<|/ref|><|det|>[[26, 31, 632, 998]]<|/det|><|end▁of▁sentence|>"
dets = sv.Detections.from_vlm(vlm=sv.VLM.DEEPSEEK_VL_2, result=result, resolution_wh=image.size)
box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator(smart_position=True)
annotated_image = box_annotator.annotate(scene=image, detections=dets)
annotated_image = label_annotator.annotate(scene=annotated_image, detections=dets)
annotated_image.save("annotated_image.png")

print(dets.xyxy)
print(dets.class_id)
print(dets.data)

Docs

  • Docs updated

@onuralpszr onuralpszr changed the title Feat/from deepseek vl 2 support feat: 🚀 from_vlm deepseek vl 2 support Jul 11, 2025
@soumik12345 soumik12345 marked this pull request as ready for review July 24, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants