Soumen commited on
Commit
92953f3
1 Parent(s): f61fc0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -105,13 +105,11 @@ def main():
105
  st.session_state["photo"]="not done"
106
 
107
  if st.session_state["photo"]=="done" or message:
108
- file_details = {"Filename":uploaded_photo_photo.name,"FileType":uploaded_photo_photo.type,"FileSize":uploaded_photo_photo.size}
109
- st.write(file_details)
110
- if uploaded_photo and uploaded_photo.type == "application/pdf":
111
- text = read_pdf(docx_file)
112
- text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
113
  st.success(text)
114
- if uploaded_photo and uploaded_photo.type=="application/image":
115
  img = Image.open(uploaded_photo)
116
  img = img.save("img.png")
117
  img = cv2.imread("img.png")
 
105
  st.session_state["photo"]="not done"
106
 
107
  if st.session_state["photo"]=="done" or message:
108
+ if st.button("Process_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
+ if uploaded_photo and uploaded_photo.type != "application/pdf":
113
  img = Image.open(uploaded_photo)
114
  img = img.save("img.png")
115
  img = cv2.imread("img.png")