Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
| 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'])):
|