Skip to content

Normalize list-returning detection models - #516

Draft
CyMule wants to merge 5 commits into
mainfrom
fix/normalize-detector-results
Draft

CyMule wants to merge 5 commits into
mainfrom
fix/normalize-detector-results

Conversation

@CyMule

@CyMule CyMule commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • normalize legacy list results from object-detection models into LayoutElements
  • perform normalization at the shared model boundary
  • update Detectron coverage and add a page-layout regression test

Why

Some built-in detection models return a list while page layout code expects LayoutElements and reads attributes such as routing. That mismatch can raise AttributeError in a normal inference route.

Compatibility note

The shared object-detection call now consistently returns LayoutElements. Out-of-tree callers that directly consumed a raw list should use .as_list() when they need the prior shape. The draft status leaves room to confirm that boundary contract.

Validation

  • uv run --locked --no-sync pytest -q test_unstructured_inference/inference/test_layout.py test_unstructured_inference/models/test_detectron2onnx.py — 59 passed
  • Ruff check and format check passed for all changed Python files
  • changelog and package versions both set to 1.6.15

Release

Targets 1.6.15, one patch above main (1.6.14), independently of the other open PRs. After another PR merges, update this PR to the next patch version on main before merging. Downstream consumers receive the change after publication and adoption of that release.

Review in cubic

CyMule added 5 commits July 19, 2026 21:18
Reconcile release notes and versions without changing authored behavior.
Retain main dependency updates and the exact certifi lock record.
All nonmetadata files equal the automatic merge of main.
Reconcile release notes and versions without changing authored behavior.
Retain main dependency updates and the exact certifi lock record.
All nonmetadata files equal the automatic merge of main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant