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

Feat/219 keep extracted image elements #225

Merged
merged 8 commits into from
Sep 26, 2023

Conversation

christinestraub
Copy link
Contributor

@christinestraub christinestraub commented Sep 22, 2023

Closes issue #219.

Summary

  • update merge_inferred_layout_with_extracted_layout to keep extracted image elements

The following documents can be used for testing and evaluation.

Testing

from unstructured_inference.inference.layout import DocumentLayout

f_path = "sample-docs/embedded-images.pdf"

# default image output directory
doc = DocumentLayout.from_file(
    filename=f_path,
    extract_images_in_pdf=True,
)

# specific image output directory
doc = DocumentLayout.from_file(
    filename=f_path,
    extract_images_in_pdf=True,
    image_output_dir_path=<directory_path>,
)

Evaluation

// Extracting Images
$ PYTHONPATH=. python examples/image_extraction/embedded-image-extraction.py Captur-1317-5_ENG-p23.pdf unstructured

// Layout Visualziation
$ PYTHONPATH=. python examples/layout_analysis/visualization.py Captur-1317-5_ENG-p23.pdf image_oly

@christinestraub christinestraub marked this pull request as ready for review September 25, 2023 18:57
Copy link
Collaborator

@badGarnet badGarnet left a comment

Choose a reason for hiding this comment

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

  1. confirmed this is working and on example pdf gets all the images
  2. test instruction has typos 😬 (path should be image_extraction not image-extraction
  3. not related to this PR but worth a followup ticket/issue: refactor the logic for inferred_is_text so it is more modular instead of buried in the long chain of function

@qued qued merged commit 00b4936 into main Sep 26, 2023
@qued qued deleted the feat/219-keep-extracted-image-elements branch September 26, 2023 18:26
benjats07 pushed a commit that referenced this pull request Sep 30, 2023
update `merge_inferred_layout_with_extracted_layout` to keep extracted image elements
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.

4 participants