当前位置:网站首页>Tensorflow realizes verification code recognition (I)
Tensorflow realizes verification code recognition (I)
2022-07-03 15:16:00 【alw_ one hundred and twenty-three】
effect
Let's see what the finished product looks like first , Finished products , With randomly generated 5W Zhang verification code for training , Training one 40 Multiple epoch, With randomly generated 2W The accuracy of Zhang Zuo's verification code is 98% The appearance of . With simple UI It's like this : 

If you want to complete the code, you can enter the portal :https://github.com/aolingwen/fuck_verifycode
Generate verification code
To identify the verification code , Of course, the first thing is to get the verification code data ~~, If the verification code data is available, you can write the crawler to catch it , But after catching it, I have to type the verification code myself label, A troubling group . If you don't want to be so troublesome, you can go and find out if there is one ready-made label Good verification code data , Or make it yourself label Good verification code data . Here , I choose to generate it myself . So here is the code generated by the verification code . A simple batch . Just use ImageCaptcha To randomly generate .
# Generate captcha image ,gen_dir It is the directory where the verification code should be landing ,total_size Is the total number of verification codes to be generated ,chars_set Is the character set of the verification code ,chars_num Is the number of characters in a verification code
def gen_verifycode_img(gen_dir, total_size, chars_set, chars_num, img_height, img_width, font_sizes):
if not os.path.exists(gen_dir):
os.makedirs(gen_dir)
image = ImageCaptcha(width=img_width, height=img_height, font_sizes=font_sizes)
for i in range(total_size):
label = ''.join(random.sample(chars_set, chars_num))
image.write(label, os.path.join(gen_dir, label+'_num'+str(i)+'.png')) Generate a good verification code , It's like this , Before file name 5 A character is the verification code label: 
Now with the verification code , Next, we need to consider how to feed the data to tensorflow 了 , Because of the big data 5W Map , So I used tfrecord Of IO The way , Write next tfrecode How to play .
边栏推荐
- 【pytorch学习笔记】Datasets and Dataloaders
- Leetcode sword offer find the number I (nine) in the sorted array
- "Seven weapons" in the "treasure chest" of machine learning: Zhou Zhihua leads the publication of the new book "machine learning theory guide"
- Remote server background hangs nohup
- Global and Chinese markets for flexible chips 2022-2028: Research Report on technology, participants, trends, market size and share
- Concurrency-01-create thread, sleep, yield, wait, join, interrupt, thread state, synchronized, park, reentrantlock
- 什么是embedding(把物体编码为一个低维稠密向量),pytorch中nn.Embedding原理及使用
- redis单线程问题强制梳理门外汉扫盲
- Introduction to redis master-slave, sentinel and cluster mode
- [attention mechanism] [first vit] Detr, end to end object detection with transformers the main components of the network are CNN and transformer
猜你喜欢

qt使用QZxing生成二维码

There are links in the linked list. Can you walk three steps faster or slower

Kubernetes帶你從頭到尾捋一遍

Characteristics of MySQL InnoDB storage engine -- Analysis of row lock
![[Yu Yue education] scientific computing and MATLAB language reference materials of Central South University](/img/83/922efb4f88843f1b7feaccf2b515b9.jpg)
[Yu Yue education] scientific computing and MATLAB language reference materials of Central South University

5.4-5.5

Final review points of human-computer interaction

Kubernetes will show you from beginning to end
![[probably the most complete in Chinese] pushgateway entry notes](/img/5a/6dcb75f5d713ff513ad6842ff53cc3.png)
[probably the most complete in Chinese] pushgateway entry notes

Functional modules and application scenarios covered by the productization of user portraits
随机推荐
视觉上位系统设计开发(halcon-winform)-4.通信管理
SQL server安装位置改不了
qt使用QZxing生成二维码
[combinatorics] permutation and combination (set permutation, step-by-step processing example)
5.4-5.5
. Net six design principles personal vernacular understanding, please correct if there is any error
redis单线程问题强制梳理门外汉扫盲
Leetcode sword offer find the number I (nine) in the sorted array
2022/02/14
Global and Chinese market of Bus HVAC systems 2022-2028: Research Report on technology, participants, trends, market size and share
【云原生训练营】模块八 Kubernetes 生命周期管理和服务发现
Kubernetes vous emmène du début à la fin
Kubernetes - yaml file interpretation
Remote server background hangs nohup
视觉上位系统设计开发(halcon-winform)-6.节点与宫格
socket. IO build distributed web push server
【注意力机制】【首篇ViT】DETR,End-to-End Object Detection with Transformers网络的主要组成是CNN和Transformer
Using TCL (tool command language) to manage Tornado (for VxWorks) can start the project
XWiki Installation Tips
Global and Chinese markets for transparent OLED displays 2022-2028: Research Report on technology, participants, trends, market size and share