December 2018
Intermediate to advanced
318 pages
8h 28m
English
Finally, we test the model such that we have built a machine learning solution that is able to crack the CAPTCHA:
from keras.models import load_modelfrom helpers import resize_to_fitfrom imutils import pathsimport numpy as npimport imutilsimport cv2import pickle
We load up the model labels and the neural network to test whether the model is able to read from the test set:
MODEL = "captcha.hdf5"MODEL_LABELS = "labels.dat"CAPTCHA_IMAGE = "generated_captcha_images"with open(MODEL_LABELS, "rb") as f: labb = pickle.load(f)model = load_model(MODEL)
We get some CAPTCHA images from different authentication sites to see whether the model is working:
captcha_image_files = list(paths.list_images(CAPTCHA_IMAGE))captcha_image_files ...
Read now
Unlock full access