Skip to content

Instantly share code, notes, and snippets.

@vaibhavgehani
Created July 26, 2020 16:46
Show Gist options
  • Select an option

  • Save vaibhavgehani/8b9bc613b7b107def0974398fa1f383b to your computer and use it in GitHub Desktop.

Select an option

Save vaibhavgehani/8b9bc613b7b107def0974398fa1f383b to your computer and use it in GitHub Desktop.
try:
from PIL import Image
except ImportError:
import Image
import pytesseract
def ocr_extraction(filename):
pytesseract.pytesseract.tesseract_cmd = r'C:/Users/intel/AppData/Local/Tesseract-OCR/tesseract.exe'
text=pytesseract.image_to_string(Image.open(filename))
return(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment