# CaptchaCracker
![](https://img.shields.io/badge/TensorFlow-2.5.0-red.svg)
![](https://img.shields.io/badge/NumPy-1.19.5-blue.svg)
[![Linkedin Badge](https://img.shields.io/badge/-WooilJeong-blue?style=plastic&logo=Linkedin&logoColor=white&link=https://www.linkedin.com/in/wooil/)](https://www.linkedin.com/in/wooil/)
[한국어 문서](https://github.com/WooilJeong/CaptchaCracker/blob/main/README-ko.md)
## 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
![png](https://github.com/WooilJeong/CaptchaCracker/raw/main/assets/example01.png)
### Output
```
023062
```
## Installation
```bash
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)
![png](https://github.com/WooilJeong/CaptchaCracker/raw/main/assets/example02.png)
```python
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
```python
import CaptchaCracker as cc
# Training image data size
img_width = 200
img_height = 50
# Training image label length
max_length = 5
# Training 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
- https://keras.io/examples/vision/captcha_ocr/
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
最新资源
- 基于springboot+Vue的交通管理在线服务系统的开发(Java毕业设计,附源码,部署教程).zip
- 基于SpringBoot+Vue的技术的美食烹饪互动平台的设计与实现(Java毕业设计,附源码,部署教程).zip
- 基于springboot+Vue的计算机学院校友网(Java毕业设计,附源码,部署教程).zip
- 基于springboot+Vue的基于个性化定制的智慧校园管理系统设计与开发(Java毕业设计,附源码,部署教程).zip
- 基于springboot+Vue的基于web的机动车号牌管理系统2(Java毕业设计,附源码,部署教程).zip
- 基于springboot+Vue的基于mysql的商业辅助决策系统的设计与实现(Java毕业设计,附源码,部署教程).zip
- 二零一九年华为杯建模竞赛C题代码及文件(二等奖)
- 基于springboot+Vue的基于Java的房地产销售管理系统的设计与实现2(Java毕业设计,附源码,部署教程).zip
- 基于springboot+Vue的机动车号牌管理系统2(Java毕业设计,附源码,部署教程).zip
- H.264/AVC实时视频分析工具H264visa
- 基于Java-Swing技...进销存管理系统的设计与实现-蒋赛文.pdf
- 全国2421个地面气象观测站站点基本信息-excel文件+标准shape文件+mxd编辑文件+Tif图片+全国shp文件
- 基于C#+mysql人事工资管理系统源码+数据库文件(高分项目).zip
- Reakistic Car Controller 插件
- 【专业渗透测试框架】Metasploit Pro v4.22.7 高级版
- springboot026基于SpringBoot的在线文档管理系统的设计与实现(源码+数据库+论文+PPT+包调试+一对一指导)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈