optical_character_recognition

@with_requirements(["easyocr"], ["os"])
def optical_character_recognition(image)

Perform optical character recognition (OCR) on the given image.

Arguments:

  • image Union[str, Image.Image] - The image to perform OCR on. It can be either a file path or an Image object.

Returns:

  • str - The extracted text from the image.

Raises:

  • FileNotFoundError - If the image file path does not exist.