Soumen commited on
Commit
3df853f
·
1 Parent(s): 8d322a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -17,7 +17,7 @@ os.environ["TOKENIZERS_PARALLELISM"] = "false"
17
  #os.system('conda install -c conda-forge poppler')
18
  import streamlit as st
19
  st.set_page_config(page_title="Summarization Tool", layout="wide", initial_sidebar_state="expanded")
20
- st.title("Chatbot and Bangla and English Summarizer: Upload Images/Pdf or input texts to summarize!")
21
  import torch
22
  import docx2txt
23
  from PIL import Image
@@ -96,7 +96,11 @@ def main():
96
  with st.container():
97
  c1, c2, c3 = st.columns([2,2,1])
98
  message = c1.text_input("Type your text here!")
99
- camera_photo = c2.camera_input("Capture a photo to summarize: ", on_change=change_photo_state)
 
 
 
 
100
  uploaded_photo = save(c3.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state))
101
  if st.session_state["photo"]=="done" or message:
102
  if uploaded_photo and uploaded_photo.type=='application/pdf':
 
17
  #os.system('conda install -c conda-forge poppler')
18
  import streamlit as st
19
  st.set_page_config(page_title="Summarization Tool", layout="wide", initial_sidebar_state="expanded")
20
+ st.title("Chatbot and Bangla/English Text Summarizer: Upload Images/Pdf or input texts to summarize!")
21
  import torch
22
  import docx2txt
23
  from PIL import Image
 
96
  with st.container():
97
  c1, c2, c3 = st.columns([2,2,1])
98
  message = c1.text_input("Type your text here!")
99
+ if st.button("CaptureImage"):
100
+ camera_photo = c2.camera_input("Capture a photo to summarize: ", on_change=change_photo_state)
101
+ if st.button("Stop camera"):
102
+ st.button("CaptureImage")=False
103
+
104
  uploaded_photo = save(c3.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state))
105
  if st.session_state["photo"]=="done" or message:
106
  if uploaded_photo and uploaded_photo.type=='application/pdf':