Add Google Gemini 3.5 VLM support#2265
Open
SkalskiP wants to merge 7 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2265 +/- ##
=======================================
Coverage 78% 78%
=======================================
Files 66 66
Lines 8406 8408 +2
=======================================
+ Hits 6524 6534 +10
+ Misses 1882 1874 -8 🚀 New features to boost your workflow:
|
f450b17 to
e99ca54
Compare
Borda
reviewed
May 22, 2026
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Borda
reviewed
May 22, 2026
Borda
approved these changes
May 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for Google Gemini 3.5 as an additional Vision-Language Model option in Supervision’s Detections.from_vlm / deprecated from_lmm pathways by treating it as format-compatible with the existing Gemini 2.5 parser.
Changes:
- Extend
VLM(and deprecatedLMM) enums and VLM validation lookup tables to includeGOOGLE_GEMINI_3_5. - Update
Detections.from_vlm/from_lmmdispatch to route Gemini 3.5 through the existing Gemini 2.5 parsing logic. - Add a parametrized regression test asserting Gemini 3.5 matches Gemini 2.5 outputs for identical inputs.
Review notes (scores):
- Code quality: 4/5
- Testing: 3/5
- Documentation: 3/5
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/supervision/detection/vlm.py |
Adds GOOGLE_GEMINI_3_5 to enums and registers it in VLM parameter/result validation tables. |
src/supervision/detection/core.py |
Extends from_lmm mapping and from_vlm dispatch so Gemini 3.5 uses the Gemini 2.5 parser path. |
tests/detection/test_vlm.py |
Adds parity test intended to ensure Gemini 3.5 produces the same detections as Gemini 2.5. |
Comment on lines
29
to
37
| Attributes: | ||
| PALIGEMMA: Google's PaliGemma vision-language model. | ||
| FLORENCE_2: Microsoft's Florence-2 vision-language model. | ||
| QWEN_2_5_VL: Qwen2.5-VL open vision-language model from Alibaba.\ | ||
| QWEN_3_VL: Qwen3-VL open vision-language model from Alibaba. | ||
| GOOGLE_GEMINI_2_0: Google Gemini 2.0 vision-language model. | ||
| GOOGLE_GEMINI_2_5: Google Gemini 2.5 vision-language model. | ||
| GOOGLE_GEMINI_3_5: Google Gemini 3.5 vision-language model. | ||
| MOONDREAM: The Moondream vision-language model. |
Comment on lines
78
to
87
| Attributes: | ||
| PALIGEMMA: Google's PaliGemma vision-language model. | ||
| FLORENCE_2: Microsoft's Florence-2 vision-language model. | ||
| QWEN_2_5_VL: Qwen2.5-VL open vision-language model from Alibaba. | ||
| QWEN_3_VL: Qwen3-VL open vision-language model from Alibaba. | ||
| GOOGLE_GEMINI_2_0: Google Gemini 2.0 vision-language model. | ||
| GOOGLE_GEMINI_2_5: Google Gemini 2.5 vision-language model. | ||
| GOOGLE_GEMINI_3_5: Google Gemini 3.5 vision-language model. | ||
| MOONDREAM: The Moondream vision-language model. | ||
| """ |
Comment on lines
+1336
to
+1343
| resolution_wh=resolution_wh, | ||
| classes=classes, | ||
| ) | ||
| detections_3_5 = Detections.from_vlm( | ||
| vlm=VLM.GOOGLE_GEMINI_3_5, | ||
| result=result, | ||
| resolution_wh=resolution_wh, | ||
| classes=classes, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GOOGLE_GEMINI_3_5to theVLM(and deprecatedLMM) enum, reusingthe existing Gemini 2.5 response parser since the output format is identical.
RESULT_TYPES,REQUIRED_ARGUMENTS,ALLOWED_ARGUMENTS) and thefrom_vlm/from_lmmdispatch logic.
VLM.GOOGLE_GEMINI_3_5produces the samedetections as
VLM.GOOGLE_GEMINI_2_5for identical inputs.