Skip to content

Instantly share code, notes, and snippets.

@ramsunvtech
Created February 25, 2024 04:38
Show Gist options
  • Save ramsunvtech/301b39d6df6085316fc3860423231ced to your computer and use it in GitHub Desktop.
Save ramsunvtech/301b39d6df6085316fc3860423231ced to your computer and use it in GitHub Desktop.
Image to Text using pytesseract
from PIL import Image
import pytesseract
# Load the image from file
img_path = '/mnt/data/image.png'
img = Image.open(img_path)
# Use tesseract to do OCR on the image
text = pytesseract.image_to_string(img)
text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment