Soumen commited on
Commit
bc59b95
1 Parent(s): c9df9a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -97,10 +97,10 @@ def main():
97
  with st.container():
98
  c1, c2, c3 = st.columns([2,2,1])
99
  message = c1.text_input("Type your text here!")
100
- if st.button("CaptureImage"):
101
  camera_photo = c2.camera_input("Capture a photo to summarize: ", on_change=change_photo_state)
102
  #st.image(camera_photo, caption='Uploaded Image', use_column_width=True)
103
- if st.button("Stop camera"):
104
  CaptureImage =False
105
  uploaded_photo = c3.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
106
  if st.session_state["photo"]=="done" or message:
@@ -131,7 +131,8 @@ def main():
131
  img = img.save("img.png")
132
  img = cv2.imread("img.png")
133
  st.text("Select the summarization type:")
134
- c4, c5 = st.columns([1,1])
 
135
  if c4.button("BENGALI"):
136
  text = pytesseract.image_to_string(img, lang="ben")
137
  st.subheader("সারাংশ/সারমর্ম")
@@ -140,7 +141,6 @@ def main():
140
  text=pytesseract.image_to_string(img)
141
  st.subheader("Summarized Text")
142
  engsum(text)
143
- #st.success(text)
144
  elif camera_photo:
145
  text=None
146
  img = Image.open(camera_photo)
@@ -148,7 +148,8 @@ def main():
148
  img = cv2.imread("img.png")
149
  #text = pytesseract.image_to_string(img) if st.checkbox("Bangla") else pytesseract.image_to_string(img, lang="ben")
150
  st.text("Select the summarization type:")
151
- c6, c7 = st.columns([1,1])
 
152
  if c6.button("Bangla"):
153
  text = pytesseract.image_to_string(img, lang="ben")
154
  st.subheader("সারাংশ/সারমর্ম")
@@ -160,7 +161,7 @@ def main():
160
  else:
161
  text=None
162
  text = message
163
- c8, c9 = st.columns([1,1])
164
  if c8.button("Bangla"):
165
  bansum(text)
166
  if c9.button("English"):
 
97
  with st.container():
98
  c1, c2, c3 = st.columns([2,2,1])
99
  message = c1.text_input("Type your text here!")
100
+ if c2.button("CaptureImage"):
101
  camera_photo = c2.camera_input("Capture a photo to summarize: ", on_change=change_photo_state)
102
  #st.image(camera_photo, caption='Uploaded Image', use_column_width=True)
103
+ if c2.button("Stop camera"):
104
  CaptureImage =False
105
  uploaded_photo = c3.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
106
  if st.session_state["photo"]=="done" or message:
 
131
  img = img.save("img.png")
132
  img = cv2.imread("img.png")
133
  st.text("Select the summarization type:")
134
+ c4, c5 = st.columns([2,2])
135
+ st.success(text)
136
  if c4.button("BENGALI"):
137
  text = pytesseract.image_to_string(img, lang="ben")
138
  st.subheader("সারাংশ/সারমর্ম")
 
141
  text=pytesseract.image_to_string(img)
142
  st.subheader("Summarized Text")
143
  engsum(text)
 
144
  elif camera_photo:
145
  text=None
146
  img = Image.open(camera_photo)
 
148
  img = cv2.imread("img.png")
149
  #text = pytesseract.image_to_string(img) if st.checkbox("Bangla") else pytesseract.image_to_string(img, lang="ben")
150
  st.text("Select the summarization type:")
151
+ c6, c7 = st.columns([2,3])
152
+ st.success(text)
153
  if c6.button("Bangla"):
154
  text = pytesseract.image_to_string(img, lang="ben")
155
  st.subheader("সারাংশ/সারমর্ম")
 
161
  else:
162
  text=None
163
  text = message
164
+ c8, c9 = st.columns([2,3])
165
  if c8.button("Bangla"):
166
  bansum(text)
167
  if c9.button("English"):