Skip to content

Instantly share code, notes, and snippets.

@AdelMmdi
Created September 13, 2024 23:26
Show Gist options
  • Select an option

  • Save AdelMmdi/e6536298b29a6bad8b73aa4837a2f365 to your computer and use it in GitHub Desktop.

Select an option

Save AdelMmdi/e6536298b29a6bad8b73aa4837a2f365 to your computer and use it in GitHub Desktop.
convert image to text words simple translate manual is better
import pytesseract as tess
from PIL import Image
import glob
path = r"C:\Users\AAAdel\Desktop\Movie"
tess.pytesseract.tesseract_cmd= r"C:\Program Files\Tesseract-OCR\tesseract.exe"
for pic in glob.glob(path+"\\*.jpg"):
img = Image.open(pic)
text= tess.image_to_string(img)
print(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment