Update app.py
Browse files
app.py
CHANGED
@@ -64,14 +64,14 @@ from PIL import Image
|
|
64 |
# all_page_text += text + " " #page.extractText()
|
65 |
# return all_page_text
|
66 |
def read_pdf_with_pdfplumber(file):
|
67 |
-
all_page_text=""
|
68 |
with pdfplumber.open(file) as pdf:
|
69 |
page = pdf.pages[0]
|
70 |
#return page.extract_text()
|
71 |
# get co-ordinates to cr
|
72 |
#img = Image.open(im)
|
73 |
-
|
74 |
-
|
75 |
## get co-ordinates to cr
|
76 |
text = pytesseract.image_to_string(image_name, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(image_name)
|
77 |
all_page_text += text + " " #page.extractText()
|
|
|
64 |
# all_page_text += text + " " #page.extractText()
|
65 |
# return all_page_text
|
66 |
def read_pdf_with_pdfplumber(file):
|
67 |
+
all_page_text=" "
|
68 |
with pdfplumber.open(file) as pdf:
|
69 |
page = pdf.pages[0]
|
70 |
#return page.extract_text()
|
71 |
# get co-ordinates to cr
|
72 |
#img = Image.open(im)
|
73 |
+
img = page.save("img.png")
|
74 |
+
image_name = cv2.imread("img.png")
|
75 |
## get co-ordinates to cr
|
76 |
text = pytesseract.image_to_string(image_name, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(image_name)
|
77 |
all_page_text += text + " " #page.extractText()
|