Spaces:
Sleeping
Sleeping
fredcaixeta
commited on
Commit
·
c83dfac
1
Parent(s):
2c1aa34
comma
Browse files- ocr_script.py +1 -1
ocr_script.py
CHANGED
|
@@ -46,5 +46,5 @@ def ocr_tesseract_only(pil_img: Image.Image, lang="por", config="--psm 6 --oem 3
|
|
| 46 |
# Converter BGR -> RGB para PIL antes do Tesseract (pytesseract aceita PIL/numpy RGB)
|
| 47 |
cv_rgb = cv2.cvtColor(cv_img, cv2.COLOR_BGR2RGB)
|
| 48 |
pil_for_ocr = Image.fromarray(cv_rgb)
|
| 49 |
-
text = pytesseract.image_to_string(pil_for_ocr, lang=lang config=config)
|
| 50 |
return text
|
|
|
|
| 46 |
# Converter BGR -> RGB para PIL antes do Tesseract (pytesseract aceita PIL/numpy RGB)
|
| 47 |
cv_rgb = cv2.cvtColor(cv_img, cv2.COLOR_BGR2RGB)
|
| 48 |
pil_for_ocr = Image.fromarray(cv_rgb)
|
| 49 |
+
text = pytesseract.image_to_string(pil_for_ocr, lang=lang, config=config)
|
| 50 |
return text
|