January 2019
Intermediate to advanced
342 pages
9h 17m
English
In this section, we are going to generate several CAPTCHAs using the Claptcha tool for training a CNN model. The CNN model will learn to identify the characters in the CAPTCHA through supervised training. We are going to generate a training and validation set for training the CNN model. In addition to this, we are going to generate a separate test set to evaluate its ability to generalize unseen data. The CaptchaGenerator.py script can be coded as follows to generate CAPTCHA data:
from claptcha import Claptchaimport osimport numpy as npimport cv2import fire from elapsedtimer import ElasedTimerdef generate_captcha(outdir,font,num_captchas=20000): alphabets = 'abcdefghijklmnopqrstuvwxyz' alphabets ...
Read now
Unlock full access