Files
kg-scr/kg_ocr/ocr/batch_processor.py

8 lines
216 B
Python

from PIL import Image
import pytesseract
def extract_text(images: list[str]) -> list[str]:
"""OCR a list of image paths into text."""
return [pytesseract.image_to_string(Image.open(img)) for img in images]