From d29fb8ad056cda3773a476fbf851522b9cff00c2 Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Mon, 14 Jul 2025 18:48:17 +0300 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=A7=AA=20add=20test=20case=20for?= =?UTF-8?q?=20Google=20Gemini=202.5=20with=20sample=20JSON=20output=20for?= =?UTF-8?q?=202=20masks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/detection/test_vlm.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/detection/test_vlm.py b/test/detection/test_vlm.py index d18e03b4..6464c234 100644 --- a/test/detection/test_vlm.py +++ b/test/detection/test_vlm.py @@ -1055,6 +1055,26 @@ def test_florence_2( np.array([np.zeros((10, 10), dtype=bool)]), ), ), + ( + does_not_raise(), + """```json + [ + {"box_2d": [100, 100, 200, 200], "mask": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAAADElEQVR4nGNgoCcAAABuAAFIXXpjAAAAAElFTkSuQmCC", "label": "cat", "confidence": 0.8}, + {"box_2d": [300, 300, 400, 400], "mask": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAAADElEQVR4nGNgoCcAAABuAAFIXXpjAAAAAElFTkSuQmCC", "label": "dog", "confidence": 0.9} + ] + ```""", # noqa E501 // docs + (10, 10), + ["cat", "dog"], + ( + np.array([[1.0, 1.0, 2.0, 2.0], [3.0, 3.0, 4.0, 4.0]]), + np.array([0, 1]), + np.array(["cat", "dog"]), + np.array([0.8, 0.9]), + np.array( + [np.zeros((10, 10), dtype=bool), np.zeros((10, 10), dtype=bool)], + ), + ), + ), ], ) def test_from_google_gemini_2_5(