Soumen commited on
Commit
5e3c2f2
·
1 Parent(s): 94c6048

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -88,7 +88,7 @@ def main():
88
  st.session_state["photo"]="done"
89
  st.subheader("Please, feed your pdf/images/text, features/services will appear automatically!")
90
  message = st.text_input("Type your text here!")
91
- uploaded_photo = st.sidebar.file_uploader("Upload your PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
92
  camera_photo = st.camera_input("Take a photo, Containing English texts", on_change=change_photo_state)
93
  if "photo" not in st.session_state:
94
  st.session_state["photo"]="not done"
@@ -120,7 +120,7 @@ def main():
120
  img = img.save("img.png")
121
  img = cv2.imread("img.png")
122
  #text = pytesseract.image_to_string(img) if st.checkbox("Bangla") else pytesseract.image_to_string(img, lang="ben")
123
- st.text("Press the content type:")
124
  if st.button("Content Type: Bangla"):
125
  text = pytesseract.image_to_string(img, lang="ben")
126
  s=1
@@ -148,6 +148,8 @@ def main():
148
  if isinstance(out, list) and out[0].get("generated_text"):
149
  text_output = out[0]["generated_text"]
150
  st.success(text_output)
151
-
 
 
152
  if __name__ == '__main__':
153
  main()
 
88
  st.session_state["photo"]="done"
89
  st.subheader("Please, feed your pdf/images/text, features/services will appear automatically!")
90
  message = st.text_input("Type your text here!")
91
+ uploaded_photo = st.sidebar.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
92
  camera_photo = st.camera_input("Take a photo, Containing English texts", on_change=change_photo_state)
93
  if "photo" not in st.session_state:
94
  st.session_state["photo"]="not done"
 
120
  img = img.save("img.png")
121
  img = cv2.imread("img.png")
122
  #text = pytesseract.image_to_string(img) if st.checkbox("Bangla") else pytesseract.image_to_string(img, lang="ben")
123
+ st.text("Please select the content type:")
124
  if st.button("Content Type: Bangla"):
125
  text = pytesseract.image_to_string(img, lang="ben")
126
  s=1
 
148
  if isinstance(out, list) and out[0].get("generated_text"):
149
  text_output = out[0]["generated_text"]
150
  st.success(text_output)
151
+ if st.button("Refresh"):
152
+ text=None
153
+ s=0
154
  if __name__ == '__main__':
155
  main()