Update app.py
Browse files
app.py
CHANGED
@@ -98,7 +98,7 @@ def main():
|
|
98 |
st.success(text)
|
99 |
st.text("Summarized text: ")
|
100 |
engsum(text)
|
101 |
-
|
102 |
text=None
|
103 |
img = Image.open(uploaded_photo)
|
104 |
img = img.save("img.png")
|
@@ -111,7 +111,7 @@ def main():
|
|
111 |
text=pytesseract.image_to_string(img)
|
112 |
engsum(text)
|
113 |
#st.success(text)
|
114 |
-
|
115 |
text=None
|
116 |
img = Image.open(camera_photo)
|
117 |
img = img.save("img.png")
|
@@ -124,7 +124,7 @@ def main():
|
|
124 |
if st.button("English"):
|
125 |
text=pytesseract.image_to_string(img)
|
126 |
engsum(text)
|
127 |
-
|
128 |
text=None
|
129 |
text = message
|
130 |
if st.button("Bangla"):
|
|
|
98 |
st.success(text)
|
99 |
st.text("Summarized text: ")
|
100 |
engsum(text)
|
101 |
+
elif uploaded_photo and uploaded_photo.type !='application/pdf':
|
102 |
text=None
|
103 |
img = Image.open(uploaded_photo)
|
104 |
img = img.save("img.png")
|
|
|
111 |
text=pytesseract.image_to_string(img)
|
112 |
engsum(text)
|
113 |
#st.success(text)
|
114 |
+
elif camera_photo:
|
115 |
text=None
|
116 |
img = Image.open(camera_photo)
|
117 |
img = img.save("img.png")
|
|
|
124 |
if st.button("English"):
|
125 |
text=pytesseract.image_to_string(img)
|
126 |
engsum(text)
|
127 |
+
else:
|
128 |
text=None
|
129 |
text = message
|
130 |
if st.button("Bangla"):
|