genelify commited on
Commit
da59e8f
·
verified ·
1 Parent(s): 6ddb2b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -7,8 +7,7 @@ def process(image_path: str, lang: str) -> list[Image.Image, str]:
7
 
8
  gray = cv2.cvtColor(np.array(image_data), cv2.COLOR_BGR2GRAY)
9
  _,threshold = cv2.threshold(gray, 127, 255, cv2.THRESH_TOZERO)
10
- custom_config = r'--oem 3 --psm 6'
11
- data = pytesseract.image_to_data(threshold, output_type=pytesseract.Output.DICT, lang=lang, config=custom_config)
12
 
13
  boxes_and_words = []
14
  for i in range(len(data['text'])):
 
7
 
8
  gray = cv2.cvtColor(np.array(image_data), cv2.COLOR_BGR2GRAY)
9
  _,threshold = cv2.threshold(gray, 127, 255, cv2.THRESH_TOZERO)
10
+ data = pytesseract.image_to_data(threshold, output_type=pytesseract.Output.DICT, lang=lang)
 
11
 
12
  boxes_and_words = []
13
  for i in range(len(data['text'])):