Soumen commited on
Commit
8cc1e8b
1 Parent(s): c08e6a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -105,15 +105,15 @@ def main():
105
  st.session_state["photo"]="not done"
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")
116
- text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
117
  st.success(text)
118
  elif camera_photo:
119
  img = Image.open(camera_photo)
 
105
  st.session_state["photo"]="not done"
106
 
107
  if st.session_state["photo"]=="done" or message:
108
+ if uploaded_photo.type == "application/pdf":
109
+ text = read_pdf(docx_file)
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")
116
+ text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
117
  st.success(text)
118
  elif camera_photo:
119
  img = Image.open(camera_photo)