当前位置:网站首页>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 .
边栏推荐
- Basic SQL tutorial
- XWiki安装使用技巧
- Centos7 deployment sentry redis (with architecture diagram, clear and easy to understand)
- [cloud native training camp] module VIII kubernetes life cycle management and service discovery
- 使用JMeter对WebService进行压力测试
- Web server code parsing - thread pool
- Troubleshooting method of CPU surge
- Enable multi-threaded download of chrome and edge browsers
- 视觉上位系统设计开发(halcon-winform)-1.流程节点设计
- redis缓存穿透,缓存击穿,缓存雪崩解决方案
猜你喜欢

Pytoch deep learning and target detection practice notes

Characteristics of MySQL InnoDB storage engine -- Analysis of row lock

Redis主从、哨兵、集群模式介绍

Yolov5系列(一)——網絡可視化工具netron

Basic SQL tutorial

Concurrency-01-create thread, sleep, yield, wait, join, interrupt, thread state, synchronized, park, reentrantlock

【注意力机制】【首篇ViT】DETR,End-to-End Object Detection with Transformers网络的主要组成是CNN和Transformer

Can‘t connect to MySQL server on ‘localhost‘

The state does not change after the assignment of El switch

What is machine reading comprehension? What are the applications? Finally someone made it clear
随机推荐
The method of parameter estimation of user-defined function in MATLAB
socket.io搭建分布式Web推送服务器
Leetcode sword offer find the number I (nine) in the sorted array
What is machine reading comprehension? What are the applications? Finally someone made it clear
Can‘t connect to MySQL server on ‘localhost‘
开启 Chrome 和 Edge 浏览器多线程下载
[daily training] 395 Longest substring with at least k repeated characters
Kubernetes帶你從頭到尾捋一遍
mysql innodb 存储引擎的特性—行锁剖析
Global and Chinese market of Bus HVAC systems 2022-2028: Research Report on technology, participants, trends, market size and share
Using notepad++ to build an arbitrary language development environment
5.4-5.5
视觉上位系统设计开发(halcon-winform)-1.流程节点设计
High quality workplace human beings must use software to recommend, and you certainly don't know the last one
[combinatorics] permutation and combination (set permutation, step-by-step processing example)
What are the composite types of Blackhorse Clickhouse, an OLAP database recognized in the industry
Global and Chinese market of iron free motors 2022-2028: Research Report on technology, participants, trends, market size and share
Finally, someone explained the financial risk management clearly
Introduction, use and principle of synchronized
什么是embedding(把物体编码为一个低维稠密向量),pytorch中nn.Embedding原理及使用