diff --git a/supervision/detection/vlm.py b/supervision/detection/vlm.py index 9892e40d..37182766 100644 --- a/supervision/detection/vlm.py +++ b/supervision/detection/vlm.py @@ -332,7 +332,7 @@ def from_qwen_2_5_vl( start = text.find("[") end = text.rfind("]") if start != -1 and end != -1 and end > start: - text = text[start: end + 1].strip() + text = text[start : end + 1].strip() try: data = json.loads(text) @@ -404,7 +404,7 @@ def from_qwen_3_vl( result=result, input_wh=(1000, 1000), resolution_wh=resolution_wh, - classes=classes + classes=classes, ) diff --git a/test/detection/test_vlm.py b/test/detection/test_vlm.py index e93b66f3..7bfc2313 100644 --- a/test/detection/test_vlm.py +++ b/test/detection/test_vlm.py @@ -320,7 +320,7 @@ def test_from_paligemma( np.array(["dog"], dtype=str), ), ), # out-of-bounds box -( + ( does_not_raise(), """[ {'bbox_2d': [10, 20, 110, 120], 'label': 'cat'} @@ -346,15 +346,15 @@ def test_from_paligemma( (640, 640), None, ( - np.array( - [ - [0.0, 0.0, 64.0, 64.0], - [10.0, 20.0, 110.0, 120.0], - ], - dtype=float, - ), - None, - np.array(["dog", "cat"], dtype=str), + np.array( + [ + [0.0, 0.0, 64.0, 64.0], + [10.0, 20.0, 110.0, 120.0], + ], + dtype=float, + ), + None, + np.array(["dog", "cat"], dtype=str), ), ), # truncated response, last object unfinished, previous ones recovered (