Update app.py
Browse files
app.py
CHANGED
|
@@ -125,10 +125,10 @@ def main():
|
|
| 125 |
if st.session_state["photo"]=="done" or message:
|
| 126 |
#text=""
|
| 127 |
if uploaded_photo.type=='application/pdf':
|
| 128 |
-
file = uploaded_photo.read() # Read the data
|
| 129 |
-
image_result = open(uploaded_photo.name, 'wb') # creates a writable image and later we can write the decoded result
|
| 130 |
-
image_result.write(file)
|
| 131 |
-
text =
|
| 132 |
#text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
|
| 133 |
st.success(text)
|
| 134 |
elif uploaded_photo.type != "application/image":
|
|
|
|
| 125 |
if st.session_state["photo"]=="done" or message:
|
| 126 |
#text=""
|
| 127 |
if uploaded_photo.type=='application/pdf':
|
| 128 |
+
#file = uploaded_photo.read() # Read the data
|
| 129 |
+
#image_result = open(uploaded_photo.name, 'wb') # creates a writable image and later we can write the decoded result
|
| 130 |
+
#image_result.write(file)
|
| 131 |
+
text = read_pdf_with_pdfplumber(uploaded_photo)
|
| 132 |
#text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
|
| 133 |
st.success(text)
|
| 134 |
elif uploaded_photo.type != "application/image":
|