
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
简体中文 | English
Captcha-Recognizer是一个易用的通用滑块验证码识别库,通过深度学习训练通用的缺口检测模型,基于训练的结果,识别出验证码中的滑块缺口位置,并返回缺口的坐标与可信度。
Python
>= 3.8.0
ultralytics
>= 8.0.0
torch
>= 1.8.0
onnxruntime
onnx
Works on Linux, Windows, macOS
文档请移步: captcha-api
pip install captcha-recognizer
from captcha_recognizer.recognizer import Recognizer
# source传入图片路径, verbose=False表示关闭冗余输出
# show_result 为True展示识别效果图 (生产环境请设置show_result=False)
# save 为True保存识别结果图 (生产环境请设置save=False)
recognizer = Recognizer()
box, confidence = recognizer.identify_gap(source='your_example_image.png', verbose=False)
print(f'缺口坐标: {box}')
print(f'可信度: {confidence}')
"""
打印结果如下:
缺口方框坐标: [331.72052001953125, 55.96122741699219, 422.079345703125, 161.7498779296875]
可信度: 0.9513089656829834
坐标原点:图片左上角
缺口方框坐标为缺口方框左上角和右下角距离坐标原点的距离
"""
包括且不限于以下类型、尺寸的滑块图片检测
示例图 1
尺寸 552*344
识别效果示例图 1
示例图 2
尺寸 260*160
识别效果示例图 2
示例图 3
尺寸 400*200
识别效果示例图3
示例图 4
尺寸 672*390
识别效果示例图4
示例图 5
尺寸 280*155
识别效果示例图 5
示例图 6
尺寸 590*360
识别效果示例图 6
示例图 7
尺寸 320*160
识别效果示例图 7
from captcha_recognizer.recognizer import Recognizer
# source传入图片路径, verbose=False表示关闭冗余输出
# show_result 为True展示识别效果图 (生产环境请设置show_result=False)
# save 为True保存识别结果图 (生产环境请设置save=False)
recognizer = Recognizer()
box, confidence = recognizer.identify_gap(source='your_example_image.png', verbose=False)
print(f'缺口坐标: {box}')
print(f'可信度: {confidence}')
"""
打印结果如下:
缺口方框坐标: [331.72052001953125, 55.96122741699219, 422.079345703125, 161.7498779296875]
可信度: 0.9513089656829834
坐标原点:图片左上角
缺口方框坐标为缺口方框左上角和右下角距离坐标原点的距离
"""
包括且不限于以下类型、尺寸的滑块验证码截图
示例图 8
尺寸 305*156
识别效果示例图 8
from captcha_recognizer.recognizer import Recognizer
# source传入图片路径或图片对象
# verbose=False表示关闭冗余输出
# show_result 为True展示识别效果图 (生产环境请设置show_result=False)
# save 为True保存识别结果图 (生产环境请设置save=False)
recognizer = Recognizer()
distance = recognizer.identify_distance_by_screenshot(source='your_screenshot.jpg')
print('滑块距离', distance)
某些种类的滑块验证码,滑块初始位置存在一定偏移,以下面图中的滑块初始位置为例:
示例图 9
如示例图9中:
某些验证码,前端渲染时会对图片进行缩放,因此实际的滑块距离也要按照图片缩放比例进行计算。
示例图 10
本项目不针对任何一家验证码厂商,项目所有内容仅供学习交流使用,不用于其他任何目的,严禁用于非法用途。
MIT license
0.7.1 (2025-03-24)
0.7.0 (2025-02-12)
0.6.0 (2024-11-13)
0.5.0 (2024-11-06)
0.4.0 (2024-10-10)
0.3.3 (2024-09-29)
0.3.2 (2024-09-24)
0.3.1 (2024-09-24)
0.3.0 (2024-09-23)
0.2.1 (2024-09-10)
0.2.0 (2024-09-10)
0.1.6 (2024-09-06)
0.1.5 (2024-09-06)
0.1.4 (2024-08-30)
0.1.3 (2024-08-26)
0.1.2 (2024-08-26)
0.1.1 (2024-08-26)
0.1.0 (2024-08-23)
FAQs
滑块验证码识别,基于YOLOv8训练,支持单缺口、多缺口、截图识别
We found that captcha-recognizer 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
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.