Created
February 25, 2024 04:38
-
-
Save ramsunvtech/301b39d6df6085316fc3860423231ced to your computer and use it in GitHub Desktop.
Image to Text using pytesseract
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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