import easyocr import logging logger = logging.getLogger(" ocr ") # Initialize the EasyOCR reader reader = easyocr.Reader(['ru']) # Specify the languages you want to support def ocr_recognize(file_path): sum_text = "" # Use EasyOCR to detect text in the photo results = reader.readtext(file_path) for result in results: [_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}') return sum_text