Soumen commited on
Commit
7c894b1
·
1 Parent(s): d82d18a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -114,20 +114,20 @@ def main():
114
  #ret,thresh1 = cv2.threshold(imge,120,255,cv2.THRESH_BINARY)
115
  # pytesseract image to string to get results
116
  #text = str(pytesseract.image_to_string(img, config='--psm 6',lang="ben")) if st.checkbox("Bangla") else str(pytesseract.image_to_string(thresh1, config='--psm 6'))
117
- text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark for Bangla Image's Text") else pytesseract.image_to_string(img)
118
  #st.success(text)
119
  elif camera_photo:
120
  img = Image.open(camera_photo)
121
  img = img.save("img.png")
122
  img = cv2.imread("img.png")
123
- text = pytesseract.image_to_string(img) if st.checkbox("Mark for Bangla Image's Text") else pytesseract.image_to_string(img, lang="ben")
124
  #st.success(text)
125
  elif uploaded_photo==None and camera_photo==None:
126
  #our_image=load_image("image.jpg")
127
  #img = cv2.imread("scholarly_text.jpg")
128
  text = message
129
 
130
- if st.checkbox("Text Generation"):
131
  def query(payload):
132
  response = requests.post(API_URL, headers=headers, json=payload)
133
  return response.json()
@@ -136,7 +136,7 @@ def main():
136
  "inputs": text,
137
  })
138
  st.success(output)
139
- if st.checkbox("Mark for Text Summarization!"):
140
  def query(payload):
141
  response = requests.post(API_URL0, headers=headers0, json=payload)
142
  return response.json()
 
114
  #ret,thresh1 = cv2.threshold(imge,120,255,cv2.THRESH_BINARY)
115
  # pytesseract image to string to get results
116
  #text = str(pytesseract.image_to_string(img, config='--psm 6',lang="ben")) if st.checkbox("Bangla") else str(pytesseract.image_to_string(thresh1, config='--psm 6'))
117
+ text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Bangla") else pytesseract.image_to_string(img)
118
  #st.success(text)
119
  elif camera_photo:
120
  img = Image.open(camera_photo)
121
  img = img.save("img.png")
122
  img = cv2.imread("img.png")
123
+ text = pytesseract.image_to_string(img) if st.checkbox("Bangla") else pytesseract.image_to_string(img, lang="ben")
124
  #st.success(text)
125
  elif uploaded_photo==None and camera_photo==None:
126
  #our_image=load_image("image.jpg")
127
  #img = cv2.imread("scholarly_text.jpg")
128
  text = message
129
 
130
+ if st.checkbox("English Text Generation"):
131
  def query(payload):
132
  response = requests.post(API_URL, headers=headers, json=payload)
133
  return response.json()
 
136
  "inputs": text,
137
  })
138
  st.success(output)
139
+ if st.checkbox("Mark for ENG Text Summarization, ENSUER MARKING ABOVE BANGLA FOR BANGLA!"):
140
  def query(payload):
141
  response = requests.post(API_URL0, headers=headers0, json=payload)
142
  return response.json()