Unstructured-IO / Unstructured-IO/unstructured-inference

Failed to draw bounding box: 'Rectangle' object has no attribute 'bbox'

Open
#289 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
209
Forks
73
PR merge metrics
No merged PRs in 30d

Description

I was following this visualization example and it throws a warning at line 48

Failed to draw bounding box: 'Rectangle' object has no attribute 'bbox'

Looking at draw_bbox it uses element.bbox.coordinates

https://github.com/Unstructured-IO/unstructured-inference/blob/a7031cc6624dee8552e550991a533b35dec17e60/unstructured_inference/visualize.py#L28

However, element Rectangle doesn't have bbox, it directly has attribute coordinates

https://github.com/Unstructured-IO/unstructured-inference/blob/a7031cc6624dee8552e550991a533b35dec17e60/unstructured_inference/inference/elements.py#L85-L88

If one of the authors can suggest an acceptable fix I can submit a PR!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/layout-analysis/visualization.py at line 48, then inspect draw_bbox in unstructured_inference/visualize.py and Rectangle in unstructured_inference/inference/elements.py. Confirm how the rectangle coordinates are exposed and make the example run without the warning while drawing the bounding box successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.