Skip to content

Commit

Permalink
fix: Removed PDF forced square resize from demo & analysis script (mi…
Browse files Browse the repository at this point in the history
…ndee#368)

* fix: Removed square resize of PDF in analysis script

* fix: Removed forced-square resize from demo
  • Loading branch information
fg-mindee authored Jul 7, 2021
1 parent a73a9f3 commit 194d7c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def main():
uploaded_file = st.sidebar.file_uploader("Upload files", type=['pdf', 'png', 'jpeg', 'jpg'])
if uploaded_file is not None:
if uploaded_file.name.endswith('.pdf'):
doc = DocumentFile.from_pdf(uploaded_file.read()).as_images(output_size=(1024, 1024))
doc = DocumentFile.from_pdf(uploaded_file.read()).as_images()
else:
doc = DocumentFile.from_images(uploaded_file.read())
cols[0].image(doc[0], width=640)
Expand Down
2 changes: 1 addition & 1 deletion scripts/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def main(args):

model = ocr_predictor(args.detection, args.recognition, pretrained=True)
if args.path.endswith(".pdf"):
doc = DocumentFile.from_pdf(args.path).as_images(output_size=(1024, 1024))
doc = DocumentFile.from_pdf(args.path).as_images()
else:
doc = DocumentFile.from_images(args.path)

Expand Down

0 comments on commit 194d7c6

Please sign in to comment.