From 5d2616093d34f2f19c8b95bca5b14adb4a2efdef Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Thu, 10 Jul 2025 19:45:02 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=9A=80=20add=20support=20for=20Go?= =?UTF-8?q?ogle=20Gemini=202.5=20detection=20processing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supervision/detection/core.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index eaba9991..ddcf125e 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -38,6 +38,7 @@ from supervision.detection.vlm import ( VLM, from_florence_2, from_google_gemini, + from_google_gemini_2_5, from_paligemma, from_qwen_2_5_vl, validate_vlm_parameters, @@ -1034,16 +1035,16 @@ class Detections: return cls(xyxy=xyxy, mask=mask, data=data) - if ( - vlm == VLM.GOOGLE_GEMINI_2_0 - or vlm == VLM.GOOGLE_GEMINI_2_5 - or vlm == VLM.GOOGLE_GEMINI_2_5_FLASH_PREVIEW - or vlm == VLM.GOOGLE_GEMINI_2_5_PRO_PREVIEW - ): + if vlm == VLM.GOOGLE_GEMINI_2_0: xyxy, class_name = from_google_gemini(result, **kwargs) data = {CLASS_NAME_DATA_FIELD: class_name} return cls(xyxy=xyxy, data=data) + if vlm == VLM.GOOGLE_GEMINI_2_5: + xyxy, class_id, class_name, mask = from_google_gemini_2_5(result, **kwargs) + data = {CLASS_NAME_DATA_FIELD: class_name} + return cls(xyxy=xyxy, class_id=class_id, mask=mask, data=data) + return cls.empty() @classmethod