Spaces:
Runtime error
Runtime error
Alex Strick van Linschoten
commited on
Commit
•
404174f
1
Parent(s):
5c79297
fix aspect issues
Browse files
app.py
CHANGED
@@ -121,10 +121,11 @@ def predict(pdf, confidence, generate_file):
|
|
121 |
os.path.join(tmp_dir, filename_without_extension, image)
|
122 |
) as img:
|
123 |
size = img.size
|
124 |
-
|
125 |
-
|
|
|
126 |
else:
|
127 |
-
pdf.add_page(
|
128 |
pred_dict = model_type.end2end_detect(
|
129 |
img,
|
130 |
valid_tfms,
|
|
|
121 |
os.path.join(tmp_dir, filename_without_extension, image)
|
122 |
) as img:
|
123 |
size = img.size
|
124 |
+
width, height = size
|
125 |
+
if width > height:
|
126 |
+
pdf.add_page((height, width))
|
127 |
else:
|
128 |
+
pdf.add_page((width, height))
|
129 |
pred_dict = model_type.end2end_detect(
|
130 |
img,
|
131 |
valid_tfms,
|