-
-
Save maksimKorzh/9fa758edbeb29c3d18159669aaf060a0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import pytesseract | |
import sys | |
import argparse | |
try: | |
import Image | |
except ImportError: | |
from PIL import Image | |
from subprocess import check_output | |
def resolve(path): | |
print("Resampling the Image") | |
check_output(['convert', path, '-resample', '600', path]) | |
return pytesseract.image_to_string(Image.open(path)) | |
if __name__=="__main__": | |
argparser = argparse.ArgumentParser() | |
argparser.add_argument('path',help = 'Captcha file path') | |
args = argparser.parse_args() | |
path = args.path | |
print('Resolving Captcha') | |
captcha_text = resolve(path) | |
print('Extracted Text',captcha_text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi I'm new on Machine Learning.Please tell me your opinions on my projects.Thank you !.