Update app.py
Browse files
app.py
CHANGED
|
@@ -106,10 +106,10 @@ def main():
|
|
| 106 |
|
| 107 |
if st.session_state["photo"]=="done" or message:
|
| 108 |
if uploaded_photo:
|
| 109 |
-
|
| 110 |
text = read_pdf(docx_file)
|
| 111 |
text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
|
| 112 |
-
|
| 113 |
img = Image.open(uploaded_photo)
|
| 114 |
img = img.save("img.png")
|
| 115 |
img = cv2.imread("img.png")
|
|
|
|
| 106 |
|
| 107 |
if st.session_state["photo"]=="done" or message:
|
| 108 |
if uploaded_photo:
|
| 109 |
+
if uploaded_photo.type == "application/pdf":
|
| 110 |
text = read_pdf(docx_file)
|
| 111 |
text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
|
| 112 |
+
else:
|
| 113 |
img = Image.open(uploaded_photo)
|
| 114 |
img = img.save("img.png")
|
| 115 |
img = cv2.imread("img.png")
|