image / tools /ocr.py
Muthuraja18's picture
Upload 11 files
0f0d66e verified
Raw
History Blame Contribute Delete
183 Bytes
from PIL import Image
import pytesseract
def extract_text(image_path: str):
img = Image.open(image_path)
text = pytesseract.image_to_string(img)
return text