Skip to content

Commit 0422a66

Browse files
committed
plug Qwen3-VL into sv.Detections.from_vlm
1 parent 9ab9650 commit 0422a66

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

supervision/detection/core.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,12 +1557,14 @@ def from_vlm(cls, vlm: VLM | str, result: str | dict, **kwargs: Any) -> Detectio
15571557
if vlm == VLM.QWEN_2_5_VL:
15581558
xyxy, class_id, class_name = from_qwen_2_5_vl(result, **kwargs)
15591559
data = {CLASS_NAME_DATA_FIELD: class_name}
1560-
return cls(xyxy=xyxy, class_id=class_id, data=data)
1560+
confidence = np.ones(len(class_id), dtype=float)
1561+
return cls(xyxy=xyxy, class_id=class_id, confidence=confidence, data=data)
15611562

15621563
if vlm == VLM.QWEN_3_VL:
15631564
xyxy, class_id, class_name = from_qwen_3_vl(result, **kwargs)
15641565
data = {CLASS_NAME_DATA_FIELD: class_name}
1565-
return cls(xyxy=xyxy, class_id=class_id, data=data)
1566+
confidence = np.ones(len(class_id), dtype=float)
1567+
return cls(xyxy=xyxy, class_id=class_id, confidence=confidence, data=data)
15661568

15671569
if vlm == VLM.DEEPSEEK_VL_2:
15681570
xyxy, class_id, class_name = from_deepseek_vl_2(result, **kwargs)

0 commit comments

Comments
 (0)