Soumen commited on
Commit
1e17e2b
·
1 Parent(s): 41c2592

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -134,7 +134,7 @@ def main():
134
  text = tet[values[0]*7*10:values[1]*7*10] if values[0]!=len(tet)//(7*10) else tet[len(tet)//(7*10):]
135
  st.success(text)
136
 
137
- if uploaded_photo.type != "application/image":
138
  img = Image.open(uploaded_photo)
139
  img = img.save("img.png")
140
  img = cv2.imread("img.png")
@@ -152,13 +152,13 @@ def main():
152
  #text = str(pytesseract.image_to_string(img, config='--psm 6',lang="ben")) if st.checkbox("Bangla") else str(pytesseract.image_to_string(thresh1, config='--psm 6'))
153
  text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
154
  st.success(text)
155
- if camera_photo:
156
  img = Image.open(camera_photo)
157
  img = img.save("img.png")
158
  img = cv2.imread("img.png")
159
  text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
160
  st.success(text)
161
- if uploaded_photo==None and camera_photo==None:
162
  #our_image=load_image("image.jpg")
163
  #img = cv2.imread("scholarly_text.jpg")
164
  text = message
 
134
  text = tet[values[0]*7*10:values[1]*7*10] if values[0]!=len(tet)//(7*10) else tet[len(tet)//(7*10):]
135
  st.success(text)
136
 
137
+ elif uploaded_photo.type == "application/image":
138
  img = Image.open(uploaded_photo)
139
  img = img.save("img.png")
140
  img = cv2.imread("img.png")
 
152
  #text = str(pytesseract.image_to_string(img, config='--psm 6',lang="ben")) if st.checkbox("Bangla") else str(pytesseract.image_to_string(thresh1, config='--psm 6'))
153
  text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
154
  st.success(text)
155
+ elif camera_photo:
156
  img = Image.open(camera_photo)
157
  img = img.save("img.png")
158
  img = cv2.imread("img.png")
159
  text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
160
  st.success(text)
161
+ elif uploaded_photo==None and camera_photo==None:
162
  #our_image=load_image("image.jpg")
163
  #img = cv2.imread("scholarly_text.jpg")
164
  text = message