MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / extract_text_from_image

Function extract_text_from_image

utils/poster_eval_utils.py:619–627  ·  view source on GitHub ↗

Open an image file and use Tesseract OCR to extract text. :param image_path: Path to the image file :return: Extracted text as a string

(image_path)

Source from the content-addressed store, hash-verified

617 return ppl.item()
618
619def extract_text_from_image(image_path):
620 """
621 Open an image file and use Tesseract OCR to extract text.
622 :param image_path: Path to the image file
623 :return: Extracted text as a string
624 """
625 image = Image.open(image_path)
626 text = pytesseract.image_to_string(image)
627 return text
628
629import tiktoken
630

Callers 2

count_words_in_imageFunction · 0.70
count_tokens_in_imageFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected