Soumen commited on
Commit
2c9d992
·
1 Parent(s): ce65dbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -106,9 +106,9 @@ def main():
106
  img = Image.open(uploaded_photo)
107
  img = img.save("img.png")
108
  img = cv2.imread("img.png")
109
- if st.checkbox("Bangla"):
110
  text = pytesseract.image_to_string(img, lang="ben")
111
- else:
112
  text=pytesseract.image_to_string(img)
113
  #st.success(text)
114
  elif camera_photo:
@@ -116,18 +116,18 @@ def main():
116
  img = img.save("img.png")
117
  img = cv2.imread("img.png")
118
  #text = pytesseract.image_to_string(img) if st.checkbox("Bangla") else pytesseract.image_to_string(img, lang="ben")
119
- if st.checkbox("Content Type: Bangla"):
120
  text = pytesseract.image_to_string(img, lang="ben")
121
- if st.checkbox("Content Type: English"):
122
  text=pytesseract.image_to_string(img)
123
- #st.success(text)
124
  elif uploaded_photo==None and camera_photo==None:
125
  text = message
126
 
127
  if st.checkbox("Mark for Text Summarization"):
128
- if st.checkbox("Summarize Bangla Texts"):
129
  bansum(text)
130
- if st.checkbox("Summarize English Texts"):
131
  engsum(text)
132
 
133
  if st.checkbox("English Text Generation"):
@@ -141,5 +141,7 @@ def main():
141
  if isinstance(out, list) and out[0].get("generated_text"):
142
  text_output = out[0]["generated_text"]
143
  st.success(text_output)
 
 
144
  if __name__ == '__main__':
145
  main()
 
106
  img = Image.open(uploaded_photo)
107
  img = img.save("img.png")
108
  img = cv2.imread("img.png")
109
+ if st.button("Content Type: Bangla"):
110
  text = pytesseract.image_to_string(img, lang="ben")
111
+ if st.button("Content Type: English"):
112
  text=pytesseract.image_to_string(img)
113
  #st.success(text)
114
  elif camera_photo:
 
116
  img = img.save("img.png")
117
  img = cv2.imread("img.png")
118
  #text = pytesseract.image_to_string(img) if st.checkbox("Bangla") else pytesseract.image_to_string(img, lang="ben")
119
+ if st.button("Content Type: Bangla"):
120
  text = pytesseract.image_to_string(img, lang="ben")
121
+ if st.button("Content Type: English"):
122
  text=pytesseract.image_to_string(img)
123
+ st.success(text)
124
  elif uploaded_photo==None and camera_photo==None:
125
  text = message
126
 
127
  if st.checkbox("Mark for Text Summarization"):
128
+ if st.button("Summarize Bangla Texts"):
129
  bansum(text)
130
+ if st.button("Summarize English Texts"):
131
  engsum(text)
132
 
133
  if st.checkbox("English Text Generation"):
 
141
  if isinstance(out, list) and out[0].get("generated_text"):
142
  text_output = out[0]["generated_text"]
143
  st.success(text_output)
144
+ if st.button("Refresh"):
145
+ st.cache_data.clear()
146
  if __name__ == '__main__':
147
  main()