Update app.py
Browse files
app.py
CHANGED
@@ -72,8 +72,8 @@ def main():
|
|
72 |
""")
|
73 |
def change_photo_state():
|
74 |
st.session_state["photo"]="done"
|
75 |
-
st.subheader("Please, feed your image!")
|
76 |
-
message = st.text_input("Or, drop your text here
|
77 |
camera_photo = st.camera_input("Take a photo, Containing English or Bangla texts", on_change=change_photo_state)
|
78 |
uploaded_photo = st.file_uploader("Upload Image, Containing English or Bangla texts",type=['jpg','png','jpeg'], on_change=change_photo_state)
|
79 |
if "photo" not in st.session_state:
|
@@ -84,13 +84,13 @@ def main():
|
|
84 |
img = Image.open(uploaded_photo)
|
85 |
img = img.save("img.png")
|
86 |
img = cv2.imread("img.png")
|
87 |
-
text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark
|
88 |
st.success(text)
|
89 |
if camera_photo:
|
90 |
img = Image.open(camera_photo)
|
91 |
img = img.save("img.png")
|
92 |
img = cv2.imread("img.png")
|
93 |
-
text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark
|
94 |
st.success(text)
|
95 |
if uploaded_photo==None and camera_photo==None:
|
96 |
#our_image=load_image("image.jpg")
|
@@ -120,7 +120,7 @@ def main():
|
|
120 |
#st.success(mess)
|
121 |
summary_result = summarize(text)
|
122 |
st.success(summary_result)
|
123 |
-
if st.checkbox("Mark
|
124 |
#st.title("Summarize Your Text for English only!")
|
125 |
tokenizer = AutoTokenizer.from_pretrained('t5-base')
|
126 |
model = AutoModelWithLMHead.from_pretrained('t5-base', return_dict=True)
|
|
|
72 |
""")
|
73 |
def change_photo_state():
|
74 |
st.session_state["photo"]="done"
|
75 |
+
st.subheader("Please, feed your image below!")
|
76 |
+
message = st.text_input("Or, drop your text here!")
|
77 |
camera_photo = st.camera_input("Take a photo, Containing English or Bangla texts", on_change=change_photo_state)
|
78 |
uploaded_photo = st.file_uploader("Upload Image, Containing English or Bangla texts",type=['jpg','png','jpeg'], on_change=change_photo_state)
|
79 |
if "photo" not in st.session_state:
|
|
|
84 |
img = Image.open(uploaded_photo)
|
85 |
img = img.save("img.png")
|
86 |
img = cv2.imread("img.png")
|
87 |
+
text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
|
88 |
st.success(text)
|
89 |
if camera_photo:
|
90 |
img = Image.open(camera_photo)
|
91 |
img = img.save("img.png")
|
92 |
img = cv2.imread("img.png")
|
93 |
+
text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
|
94 |
st.success(text)
|
95 |
if uploaded_photo==None and camera_photo==None:
|
96 |
#our_image=load_image("image.jpg")
|
|
|
120 |
#st.success(mess)
|
121 |
summary_result = summarize(text)
|
122 |
st.success(summary_result)
|
123 |
+
if st.checkbox("Mark to better English Text Summarization!"):
|
124 |
#st.title("Summarize Your Text for English only!")
|
125 |
tokenizer = AutoTokenizer.from_pretrained('t5-base')
|
126 |
model = AutoModelWithLMHead.from_pretrained('t5-base', return_dict=True)
|