CaptchaCracker - Deep Learning-based Captcha Recognizer
Hello!

I made a python open source project.

**Github Repository:** [https://github.com/WooilJeong/CaptchaCracker](https://github.com/WooilJeong/CaptchaCracker)

# CaptchaCracker

## Introduction

CaptchaCracker is an open source Python library that provides functions to create and apply deep learning models for Captcha Image recognition. You can create a deep learning model that recognizes numbers in the Captcha Image as shown below and outputs a string of numbers, or you can try the model yourself.

## Input

https://preview.redd.it/qltiatrqxgr81.png?width=250&amp;format=png&amp;auto=webp&amp;s=8e4d370203ff502b4681c8b35a8fee1cff7fd259

## Output

    023062

## Installation

    pip install CaptchaCracker

## Dependency

    pip install numpy==1.19.5 tensorflow==2.5.0

## Examples

## Train and save the model

Before executing model training, training data image files in which the actual value of the Captcha image is indicated in the file name should be prepared as shown below.

* [Download Sample Dataset](https://github.com/WooilJeong/CaptchaCracker/raw/main/sample.zip)

https://preview.redd.it/n451dp4sxgr81.png?width=1009&amp;format=png&amp;auto=webp&amp;s=2c0173b4d685f73642edbfd780ae3fdf4d921bdf

    import glob
    from CaptchaCracker import CreateModel
    
    train_img_path_list = glob.glob("../data/train_numbers_only/*.png")
    
    CM = CreateModel(train_img_path_list)
    model = CM.train_model(epochs=100)
    model.save_weights("../model/weights.h5")

## Load a saved model to make predictions

    from CaptchaCracker import ApplyModel
    
    weights_path = "../model/weights.h5"
    AM = ApplyModel(weights_path)
    
    target_img_path = "../data/target.png"
    pred = AM.predict(target_img_path)
    print(pred)