ocr-fix
This commit is contained in:
parent
17cc9dd8b6
commit
7a899a9593
10
nlp/ocr.py
10
nlp/ocr.py
|
@ -11,11 +11,11 @@ def ocr_recognize(file_path):
|
||||||
|
|
||||||
# Use EasyOCR to detect text in the photo
|
# Use EasyOCR to detect text in the photo
|
||||||
results = reader.readtext(file_path)
|
results = reader.readtext(file_path)
|
||||||
for result in results:
|
result = result[-1]
|
||||||
[_coords, ocr_text, ocr_accuracy] = result
|
[_coords, ocr_text, ocr_accuracy] = result
|
||||||
logger.debug("OCR Result: %s", ocr_text)
|
logger.debug("OCR Result: %s", ocr_text)
|
||||||
if ocr_accuracy.item() > 0.5:
|
if ocr_accuracy.item() > 0.5:
|
||||||
sum_text += " " + ocr_text
|
sum_text += " " + ocr_text
|
||||||
|
|
||||||
|
|
||||||
logger.debug(f'Recognized Text: {sum_text}')
|
logger.debug(f'Recognized Text: {sum_text}')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user