Aqdas commited on
Commit
6b5cf77
·
verified ·
1 Parent(s): 0fd082f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
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
- convert_image = pdf_to_image(pdf_path)
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 image_path in all_images:
41
- text = image_to_text(image_path)
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