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