Skip to content

Conversation

@qued
Copy link
Contributor

@qued qued commented Jan 12, 2023

Prepping release I realized some changes I thought I'd made never got in.

  • Added is_image flag for process_data_with_model and process_file_with_model
  • Added support for the above in the API
  • Added testing for all of the above

Testing:

Run from python terminal:

from unstructured_inference.inference.layout import process_file_with_model

res = process_file_with_model('sample-docs/loremipsum.png', is_image=True)
res.pages[0].elements
print(res)

The output should show that several Text elements were found.

Run make run-app-dev and from a separate terminal make the following request:

curl -X 'POST' \
  'http://localhost:8000/layout/image' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'file=@sample-docs/loremipsum.png' | jq -C . | less -R

The output should show that several Text elements were found.

@qued qued requested a review from MthwRobinson January 12, 2023 18:48
Copy link
Contributor

@MthwRobinson MthwRobinson left a comment

Choose a reason for hiding this comment

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

LGTM! Just note that I had to change the process_file_with_model line to the following in the test instructions for it to work:

res = process_file_with_model(filename='sample-docs/loremipsum.png', model_name=None, is_image=True)

@qued qued merged commit a21325f into main Jan 12, 2023
@qued qued deleted the chore/release-image branch January 12, 2023 19:21
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.

3 participants