CaptchaCracker is an open source Python library that provides functions to create and apply deep learning models for Captcha Image recognition.
Project description
Open source Python Deep Learning low-code library for generating captcha image recognition models
🚀pip install CaptchaCracker --upgrade
CaptchaCracker
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
Output
023062
Web Demo
Integrated into Huggingface Spaces 🤗 using Gradio. Try out the Web Demo:
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.
import glob
import CaptchaCracker as cc
# Training image data path
train_img_path_list = glob.glob("../data/train_numbers_only/*.png")
# Training image data size
img_width = 200
img_height = 50
# Creating an instance that creates a model
CM = cc.CreateModel(train_img_path_list, img_width, img_height)
# Performing model training
model = CM.train_model(epochs=100)
# Saving the weights learned by the model to a file
model.save_weights("../model/weights.h5")
Load a saved model to make predictions
import CaptchaCracker as cc
# Target image data size
img_width = 200
img_height = 50
# Target image label length
max_length = 6
# Target image label component
characters = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
# Model weight file path
weights_path = "../model/weights.h5"
# Creating a model application instance
AM = cc.ApplyModel(weights_path, img_width, img_height, max_length, characters)
# Target image path
target_img_path = "../data/target.png"
# Predicted value
pred = AM.predict(target_img_path)
print(pred)
References
Contributors
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file CaptchaCracker-0.0.7.tar.gz
.
File metadata
- Download URL: CaptchaCracker-0.0.7.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f813927c51e4a609b2ef5b5cb4081e034a271c4ca942acfd3ca929ce4bc08b3 |
|
MD5 | 9cb5f9b74b27a5c55726ddab791901c6 |
|
BLAKE2b-256 | ddee2e0c7f7f6c9eb6b16d8dd8fe20d30324398209c9ac085d098e5fb955f85a |
File details
Details for the file CaptchaCracker-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: CaptchaCracker-0.0.7-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e21adf44dffe0daf6f3c07a0378582d26aaf8e8f7243ecea628de3b9f3f68a3 |
|
MD5 | f7b4381b387ccc58d44686c31c419657 |
|
BLAKE2b-256 | ba4889897109f6b6aae28e195859fb5ef84087a0ee4b5d3f0f3a4c7a0577c834 |