Spaces:
Runtime error
Runtime error
Update src/utils/text_ocr.py
Browse files- src/utils/text_ocr.py +1 -1
src/utils/text_ocr.py
CHANGED
|
@@ -110,7 +110,7 @@ def pytesseract_ocr_detection(image_path):
|
|
| 110 |
|
| 111 |
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
| 112 |
_, thresh = cv2.threshold(gray, 180, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)
|
| 113 |
-
data = pytesseract.image_to_data(thresh,
|
| 114 |
|
| 115 |
detected_text = []
|
| 116 |
n_boxes = len(data['text'])
|
|
|
|
| 110 |
|
| 111 |
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
| 112 |
_, thresh = cv2.threshold(gray, 180, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)
|
| 113 |
+
data = pytesseract.image_to_data(thresh, output_type=pytesseract.Output.DICT)
|
| 114 |
|
| 115 |
detected_text = []
|
| 116 |
n_boxes = len(data['text'])
|