Update app.py
Browse files
app.py
CHANGED
|
@@ -168,13 +168,13 @@ def main():
|
|
| 168 |
#ret,thresh1 = cv2.threshold(imge,120,255,cv2.THRESH_BINARY)
|
| 169 |
# pytesseract image to string to get results
|
| 170 |
#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'))
|
| 171 |
-
text = pytesseract.image_to_string(img) if st.checkbox("Mark to see English Image's Text") else pytesseract.image_to_string(img,
|
| 172 |
st.success(text)
|
| 173 |
elif camera_photo:
|
| 174 |
img = Image.open(camera_photo)
|
| 175 |
img = img.save("img.png")
|
| 176 |
img = cv2.imread("img.png")
|
| 177 |
-
text = pytesseract.image_to_string(img) if st.checkbox("Mark to see English Image's Text") else pytesseract.image_to_string(img,
|
| 178 |
st.success(text)
|
| 179 |
elif uploaded_photo==None and camera_photo==None:
|
| 180 |
#our_image=load_image("image.jpg")
|
|
|
|
| 168 |
#ret,thresh1 = cv2.threshold(imge,120,255,cv2.THRESH_BINARY)
|
| 169 |
# pytesseract image to string to get results
|
| 170 |
#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'))
|
| 171 |
+
text = pytesseract.image_to_string(img) if st.checkbox("Mark to see English Image's Text") else pytesseract.image_to_string(img, lang="ben")
|
| 172 |
st.success(text)
|
| 173 |
elif camera_photo:
|
| 174 |
img = Image.open(camera_photo)
|
| 175 |
img = img.save("img.png")
|
| 176 |
img = cv2.imread("img.png")
|
| 177 |
+
text = pytesseract.image_to_string(img) if st.checkbox("Mark to see English Image's Text") else pytesseract.image_to_string(img, lang="ben")
|
| 178 |
st.success(text)
|
| 179 |
elif uploaded_photo==None and camera_photo==None:
|
| 180 |
#our_image=load_image("image.jpg")
|