supervision/docs
Ruben 44546a13f2
fix(vlm): handle malformed Gemini/Qwen model output without crashing (#2342)
Two ways the VLM parsers crashed on adversarial model output instead of
degrading gracefully (the contract they already honor for invalid JSON):

1. Gemini 2.5: a mask value that is not a 'data:image/png;base64,' string
   appended an empty mask and then 'continue'd, skipping the confidence
   handler at the bottom of the loop. The item's box was recorded but its
   confidence was not, so the confidence array ended up shorter than xyxy
   and Detections.from_vlm raised a shape ValueError. Replaced the
   'continue' with an if/else so the confidence handler always runs.

2. Gemini 2.0 / Gemini 2.5 / Qwen 2.5: valid JSON whose top level is not a
   list, or whose elements are not dicts (e.g. '[1, 2, 3]'), raised
   TypeError from the 'key not in item' membership test. Added a top-level
   list guard (Gemini 2.0/2.5; Qwen already had one) and a per-element
   dict guard so wrong-shaped JSON degrades to empty Detections.

Add regression tests for the mask/confidence alignment and for graceful
degradation across all three parsers.

---------

Co-authored-by: jirka <6035284+Borda@users.noreply.github.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-06-18 15:31:31 +02:00
..
assets add lenny 2023-12-04 17:03:05 +00:00
classification docs(fix): 🐞📝 removal of table of content duplicates core(Detections,Classification) 2024-01-31 15:09:07 +03:00
datasets chore: update `mdformat` hook arguments to disable wrapping (#2307) 2026-06-09 16:15:05 +02:00
detection fix(obb): NMM now computes geometric union via min-area rotated rect (#2312) 2026-06-15 16:23:31 +02:00
how_to chore: update `mdformat` hook arguments to disable wrapping (#2307) 2026-06-09 16:15:05 +02:00
javascripts docs: fix copy doctests without `>>>` and `...` by button & ctr+c (#2138) 2026-02-04 23:09:16 +09:00
keypoint refactor: enrich `KeyPoints` with visibility mask, split confidence fields, and redesign uncertainty annotator (#2286) 2026-06-11 18:34:33 +02:00
metrics fix(docs): expand llms.txt, add FAQ schema, author attribution to how… (#2231) 2026-04-23 18:33:14 +02:00
notebooks docs(cookbooks): add Oriented Bounding Boxes cookbook (#2314) 2026-06-18 13:33:30 +02:00
stylesheets after few tests drop support for `pycon` in docs examples 2025-08-07 07:41:52 +02:00
theme docs(cookbooks): add Oriented Bounding Boxes cookbook (#2314) 2026-06-18 13:33:30 +02:00
utils reimplement `crop_image` to skip type casting when Pillow Image given 2025-11-14 17:55:07 +01:00
0d5d9799b1cc4a39825146388c6781eb.txt feat(docs): add GEO infrastructure for AI search visibility (#2224) 2026-04-21 11:40:44 +02:00
CNAME Create CNAME 2023-08-22 13:08:10 +01:00
_headers docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
about.md docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
assets.md chore: update `mdformat` hook arguments to disable wrapping (#2307) 2026-06-09 16:15:05 +02:00
changelog.md fix(vlm): handle malformed Gemini/Qwen model output without crashing (#2342) 2026-06-18 15:31:31 +02:00
code_of_conduct.md move CODE_OF_CONDUCT.md and CONTRIBUTING.md for improved accessibility (#2036) 2026-02-03 03:58:28 +01:00
contact.md docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
contributing.md move CODE_OF_CONDUCT.md and CONTRIBUTING.md for improved accessibility (#2036) 2026-02-03 03:58:28 +01:00
cookbooks.md fix(docs): expand llms.txt, add FAQ schema, author attribution to how… (#2231) 2026-04-23 18:33:14 +02:00
deprecated.md refactor: privatize validation helpers (#2294) 2026-06-06 13:15:54 -06:00
faq.md docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
index.md chore: update `mdformat` hook arguments to disable wrapping (#2307) 2026-06-09 16:15:05 +02:00
license.md docs: contributing.md/code_of_conduct/license added into docs 2024-01-31 22:10:28 +03:00
llms-100k.txt docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
llms.full.txt docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
llms.txt docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
robots.txt docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
trackers.md feat(docs): add GEO infrastructure for AI search visibility (#2224) 2026-04-21 11:40:44 +02:00