Skip to main content

AntiCAP

Project description

logo

AntiCAP

Version:3.1.7

类型 状态 描述
OCR识别 返回图片字符串
数学计算 返回计算结果
缺口滑块 返回坐标
阴影滑块 返回坐标
图标点选 侦测图标位置 或 按序返回坐标
文字点选 侦测文字位置 或 按序返回坐标
相似对比 图片中文字的相似度对比
WebApi服务 https://github.com/81NewArk/AntiCAP-WebApi

免责声明

本项目仅用于学习和研究目的,严禁将其用于任何违反中华人民共和国法律法规、第三方服务条款或社会伦理的行为。开发者不对因本项目的使用、传播或修改所产生的任何直接或间接后果承担责任。

使用本项目即表示您理解并自动遵守以下条款:

  1. 合法使用:不得将本项目用于恶意攻击、网络诈骗、绕过身份验证、未经授权的数据抓取、验证码识别滥用等非法用途。

  2. 风险自负:您自愿承担使用本项目所带来的一切法律和技术风险,包括但不限于服务封禁、数据丢失、法律纠纷等。

  3. 开发者免责:项目作者对任何因使用本项目而引发的损失、损害、违法行为或法律责任不承担任何形式的赔偿或担保义务。

  4. 禁止商业化滥用:不得将本项目用于违法牟利,包括但不限于变相收费、集成进商业软件、参与“黑产”活动等。


若您不同意上述条款,请立即停止使用并删除本项目。


📄 AntiCAP 文档

🌍环境说明

python >=3.8  64bit

📁 安装

Pypi下载

pip install AntiCAP -i https://pypi.tuna.tsinghua.edu.cn/simple

🤖 调用说明

1. 通用OCR识别

参考例图 (数字、大小写字母、汉字)

# example.py

import base64
import AntiCAP


with open("captcha.jpg", "rb") as img_file:
    img_base64 = base64.b64encode(img_file.read()).decode('utf-8')


Atc = AntiCAP.Handler(show_banner=True)
result = Atc.OCR(img_base64=img_base64) #传入图片Base64编码字符串

print(result) # 返回字符串 jepy

2. 算术验证码识别

参考例图 (加减乘除类) 目前模型泛化能力较弱 等待更新

# example.py

import base64
import AntiCAP


with open("captcha.jpg", "rb") as img_file:
    img_base64 = base64.b64encode(img_file.read()).decode('utf-8')


Atc = AntiCAP.Handler(show_banner=True)
result = Atc.Math(img_base64=img_base64) #传入图片Base64编码字符串

print(result) #返回计算结果 8

3. 图标侦测

参考例图

# example.py

import base64
import AntiCAP


with open("captcha.jpg", "rb") as img_file:
    img_base64 = base64.b64encode(img_file.read()).decode('utf-8')


Atc = AntiCAP.Handler(show_banner=True)
result = Atc.Detection_Icon(img_base64=img_base64) #传入图片Base64编码字符串

print(result)

# [{'class': 'icon', 'box': [9.12, 105.4, 111.73, 223.02]}...]
# box分别为 [x1, y1, x2, y2] 左上角和右下角坐标

4. 文字侦测

参考例图

# example.py

import base64
import AntiCAP


with open("captcha.jpg", "rb") as img_file:
    img_base64 = base64.b64encode(img_file.read()).decode('utf-8')


Atc = AntiCAP.Handler(show_banner=True)
result = Atc.Detection_Text(img_base64=img_base64) #传入图片Base64编码字符串

print(result)
# [{'class': 'Text', 'box': [145.71, 19.21, 223.99, 95.7]}...]
# box分别为 [x1, y1, x2, y2] 左上角和右下角坐标

5. 图标点选类

提示图

目标图片

# example.py

import base64
import AntiCAP

with open("order_image.jpg", "rb") as f:
    order_img_base64 = base64.b64encode(f.read()).decode('utf-8')

# 读取目标图(所有图标)并转为 base64
with open("target_image.jpg", "rb") as f:
    target_img_base64 = base64.b64encode(f.read()).decode('utf-8')

Atc = AntiCAP.Handler(show_banner=True)
result = Atc.ClickIcon_Order(
    order_img_base64=order_img_base64,
    target_img_base64=target_img_base64
)

print(result)

6. 文字点选类

提示图

目标图片

# example.py

import base64
import AntiCAP

with open("order_image.jpg", "rb") as f:
    order_img_base64 = base64.b64encode(f.read()).decode('utf-8')

# 读取目标图(所有图标)并转为 base64
with open("target_image.jpg", "rb") as f:
    target_img_base64 = base64.b64encode(f.read()).decode('utf-8')

Atc = AntiCAP.Handler(show_banner=True)
result = Atc.ClickIcon_Order(
    order_img_base64=order_img_base64,
    target_img_base64=target_img_base64
)

print(result)

7. 缺口滑块类

缺口图

背景图

# example.py

import base64
import AntiCAP

# 读取滑块图片(小块)
with open("slider.png", "rb") as f:
    target_base64 = base64.b64encode(f.read()).decode('utf-8')

# 读取背景图片(带缺口的大图)
with open("background.jpg", "rb") as f:
    background_base64 = base64.b64encode(f.read()).decode('utf-8')


Atc = AntiCAP.Handler(show_banner=True)

result = Atc.Slider_Match(target_base64=target_base64,
                          background_base64=background_base64
)

print(result)

8. 阴影滑块类

目标图片

背景图片

# example.py

import base64
import AntiCAP

# 读取滑块图片(小块)
with open("target.jpg", "rb") as f:
    target_base64 = base64.b64encode(f.read()).decode('utf-8')

# 读取背景图片(带缺口的大图)
with open("background.jpg", "rb") as f:
    background_base64 = base64.b64encode(f.read()).decode('utf-8')


Atc = AntiCAP.Handler(show_banner=True)

result = Atc.Slider_Match(target_base64=target_base64,
                          background_base64=background_base64
)

print(result)

9. 相似度对比

图片1

图片2

# example.py
import base64
import AntiCAP

with open("image1.jpg", "rb") as f:
    image1_base64 = base64.b64encode(f.read()).decode('utf-8')

with open("image2.jpg", "rb") as f:
    image2_base64 = base64.b64encode(f.read()).decode('utf-8')


Atc = AntiCAP.Handler(show_banner=True)

result = Atc.compare_image_similarity(image1_base64=image1_base64, image2_base64=image2_base64)

print("相似度结果:", result)

🐧 QQ交流群


QQGroup

🚬 请作者抽一包香香软软的利群


Ali Wx

💪🏼 模型训练


https://github.com/81NewArk/AntiCAP_trainer

根据自身要求训练模型 无缝衔接下一个 下一个更乖。

😚 致谢名单

这份荣光我不会独享

[1] Ddddocr作者 网名:sml2h3

[2] 微信公众号 OneByOne 网名:十一姐

[3] 苏州大学,苏州大学文正学院 计算机科学与技术学院 张文哲教授

[4] 苏州大学,苏州大学文正学院 计算机科学与技术学院 王辉教授

[5] 苏州市职业大学,苏州大学文正学院 计算机科学与技术学院 陆公正副教授

[6] 武汉科锐软件安全教育机构 钱林松讲师 网名:Backer

📚 参考文献

[1] Github. 2025.03.28 https://github.com/sml2h3

[2] Github. 2025.03.28 https://github.com/2833844911/

[3] Bilibili. 2025.03.28 https://space.bilibili.com/308704191

[4] Bilibili. 2025.03.28 https://space.bilibili.com/472467171

[5] Ultralytics. 2025.03.28 https://docs.ultralytics.com/modes/train/

[6] YRL's Blog. 2025.03.28 https://blog.2zxz.com/archives/icondetection

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anticap-3.1.7.tar.gz (133.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anticap-3.1.7-py3-none-any.whl (133.3 MB view details)

Uploaded Python 3

File details

Details for the file anticap-3.1.7.tar.gz.

File metadata

  • Download URL: anticap-3.1.7.tar.gz
  • Upload date:
  • Size: 133.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for anticap-3.1.7.tar.gz
Algorithm Hash digest
SHA256 806d9840aba1a67db630b0dd49e9f76cad6dfde36412608b148a486f26f40bc5
MD5 f558cd03cb060f909f9164b4324dfb81
BLAKE2b-256 9e18d3f307a0277f0376674ddcde06b8690b0c442cde9b44ffcc987dcacba425

See more details on using hashes here.

File details

Details for the file anticap-3.1.7-py3-none-any.whl.

File metadata

  • Download URL: anticap-3.1.7-py3-none-any.whl
  • Upload date:
  • Size: 133.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for anticap-3.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 707b1ba86af29bd9160820716d2dedc32adca556d92f214912a2b9f7902b3968
MD5 44515831e609fc3c9d7e1921557e6f90
BLAKE2b-256 cb5410de90bf080222e963cc53ed554434ceb7e690452ad487682b5e792af5b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page