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