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