Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: annotate image is fixed after refactor #262

Merged
merged 3 commits into from
Oct 19, 2023
Merged

fix: annotate image is fixed after refactor #262

merged 3 commits into from
Oct 19, 2023

Conversation

benjats07
Copy link
Contributor

@benjats07 benjats07 commented Oct 18, 2023

Currently the code for annotate() don't add details when add_details=True, for example:

from unstructured_inference.inference.layout import DocumentLayout
from unstructured_inference.models.base import get_model

file = "example-docs/layout-parser-paper-fast.pdf"
model = get_model("yolox_quantized")
doc = DocumentLayout.from_file(file,model)

for i,page in enumerate(doc.pages):
    page.annotate(add_details=True).save(f"{i}.png")

After this PR is merged, the resulting image should show origin for all elements using the same code.

@benjats07 benjats07 requested a review from qued October 18, 2023 21:17
@benjats07 benjats07 marked this pull request as ready for review October 18, 2023 22:21
@benjats07 benjats07 requested a review from ajjimeno October 18, 2023 22:21
Copy link
Contributor

@ajjimeno ajjimeno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I was not aware of this functionality.

@ajjimeno ajjimeno merged commit 2ee38e6 into main Oct 19, 2023
8 checks passed
@ajjimeno ajjimeno deleted the fix/sources branch October 19, 2023 02:02
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.

2 participants