Faiss commited on
Commit
46769c7
1 Parent(s): 886766a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -4,7 +4,7 @@ def process(image: str, lang: str = 'eng') -> str:
4
  try:
5
  img = cv2.imread(image)
6
  gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
7
- threshold_img = cv2.threshold(gray, 127, 255, cv2.THRESH_TOZERO)[1]
8
  result = pytesseract.image_to_string(threshold_img, lang=lang)
9
  os.remove(image)
10
  return result
 
4
  try:
5
  img = cv2.imread(image)
6
  gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
7
+ _,threshold_img = cv2.threshold(gray, 127, 255, cv2.THRESH_TOZERO)
8
  result = pytesseract.image_to_string(threshold_img, lang=lang)
9
  os.remove(image)
10
  return result