Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,14 +31,11 @@ if uploaded_files:
|
|
| 31 |
st.write(f'This is {uploaded_files}')
|
| 32 |
if st.button('Extract'):
|
| 33 |
for pdf_path in uploaded_files:
|
| 34 |
-
|
| 35 |
-
convert_image.save_image(f'{pdf_path}image')
|
| 36 |
-
print('one_pdf_converted')
|
| 37 |
|
| 38 |
-
all_images = glob.glob(os.path.join(folder_name, '*.jpg'))
|
| 39 |
all_texts = []
|
| 40 |
-
for
|
| 41 |
-
text = image_to_text(
|
| 42 |
all_texts.append(text)
|
| 43 |
print('one text appended')
|
| 44 |
|
|
|
|
| 31 |
st.write(f'This is {uploaded_files}')
|
| 32 |
if st.button('Extract'):
|
| 33 |
for pdf_path in uploaded_files:
|
| 34 |
+
image_bytes = pdf_to_image(pdf_path)
|
|
|
|
|
|
|
| 35 |
|
|
|
|
| 36 |
all_texts = []
|
| 37 |
+
for image_byte in image_bytes:
|
| 38 |
+
text = image_to_text(image_byte)
|
| 39 |
all_texts.append(text)
|
| 40 |
print('one text appended')
|
| 41 |
|