
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
针对于Sichuan University的JWC验证码特化训练的轻量级深度学习模型,基于Pytorch,模型为CNN(卷积神经网络)。
训练集 | 测试集 | 实际使用于JWC |
---|---|---|
98.915001% | 98.715001% | 大约90% |
训练过程中一直在修改超参数,所以错误率有较多波动,实际使用时JWC还是会有更大的误差,毕竟数据集不完全一致,但是通过多次重复足够使用了。
训练集8万个,测试集2万个,根据JWC网站的统计,只包含如下字符:2345678abcdefgmnpwxy
,共20个字符随机排列组合生成的4位验证码。
数据集采用谷歌的Kaptcha生成。
实际使用时魔改了此Github仓库的代码用于渲染生成:
因为魔改实在过于丑陋,就不放本人的源代码在这里了。
此处提供1万数据量的数据集,有需要可以取用,后续有需要可以提供10万的数据集到网盘:
1GB
的空间安装Pytorch,具体安装请参见Pytorch官网pip install scu_captcha
随后就可以通过使用如下代码导入本包的两个组件
from scu_captcha import imgLoader,Predict
导入后,即可使用这两个函数进行验证码识别。
对于一张图片,imgLoader
提供两种方式进行图片加载,分别是通过相对路径导入或二进制图片文件直接导入,然后将得到的对象输入Predict
函数即可返回对应字符串:
# 直接使用二进制方式预测
session = requests.session() # 使用网络请求库
# 通过网络请求获得验证码二进制图像
byte_Captcha = session.get(url=captcha_url, headers=header).content
img = imgLoader(byte_Captcha) # 导入二进制图片
res = Predict(img) # 进行预测,并输出预测的str到res对象
# 使用相对路径导入图片预测
# 此处为输出到图片,如果图片本身就存在,则无需此步骤
with open("captcha.jpg", "wb") as f:
f.write(byte_Captcha)
# 根据相对路径读入文件
img = imgLoader("captcha.jpg")
res = Predict(img) # 进行预测,并输出预测的str到res对象
具体用法也可参见TEST.py。
FAQs
SCU captcha recongnition based on Pytorch
We found that scu-captcha demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.