Skip to content

Generator and solver of Captcha images in Python.

Notifications You must be signed in to change notification settings

Bralor/captcha-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Captcha solver


Library for the captcha image generation and recognition.


Installation


Run command:

$ pip install -e .

Image generation


First thing first, you need to generate content of captcha image.

You can create a single string:

>>> from src.content_creator import CaptchaContentGenerator as ccg
>>> single = ccg(length=5, samples=1, numbers=True, lowercase=True, uppercase=True)
>>> single
1aD3x

... or a batch:

>>> from src.content_creator import CaptchaContentGenerator as ccg
>>> samples = ccg(length=5, samples=4, numbers=True, lowercase=True, uppercase=True)
>>> samples
XpXJs, 3YUFp, FyNmg, xqujI

... then you can generate PNG files:

>>> from src.captcha_generator import DatasetGenerator as dg
>>> images = dg(size_x=180, size_y=50, content=samples)

INFO: Setting up the resolution (180x50),
INFO: do not forget to specify argument FOLDER,

>>> images.folder = "images"

INFO: Creating the output folder 'images',

>>> image.create_images()

INFO: Images have been saved into the folder 'images'.

Then you may check the captcha images in the 'images' folder.


Project layout


/captcha
  ├─README.md
  ├─requirements.txt
  └─csolver
     ├─generator.py
     ├─solver.py
     ├─tests/
     └─data/

About

Generator and solver of Captcha images in Python.

Topics

Resources

Stars

Watchers

Forks