Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. from PIL import Image
  2. import pytesseract
  3. import os
  4.  
  5. s = ''
  6. for i in range(31722):
  7. pjg = len(str(i))
  8. count = '0'*(8-pjg)+str(i)
  9. pth = 'output/jpg/{}.jpg'.format(count)
  10. if os.path.exists(pth):
  11. im = Image.open(pth)
  12. text = pytesseract.image_to_string(im, lang='eng')
  13. s+=text
  14.  
  15. print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement