Skip to main content

CapSpot

CAPTCHA Resolution Tool

PyPI [//]: # (License)

Introduction

CapSpot is an image matching library based on ONNX models that locates and identifies sub-images within a target image using a template. It is designed to solve CAPTCHA challenges by finding specific click points in images, making it an invaluable tool for automated testing and security applications.

Example Outputs

Example 1

  • Target Image

test.png

  • Detection Template and Order

test_mo.png

  • Detection Results

result.png

  • JSON Response
{'img0': [103, 35, 145, 76], 'img1': [162, 90, 196, 127], 'img2': [175, 189, 199, 218]}

Example 2

  • Target Image

    test1.png

  • Detection Template and Order

    test1_mo.png

  • Detection Results

result1.png

  • JSON Response
{'img0': [24, 28, 89, 93], 'img1': [243, 60, 300, 119], 'img2': [134, 128, 191, 184]}

Features

    • Utilizes pre-trained ONNX models for object detection and similarity calculations.
    • Supports optional GPU acceleration.
    • Offers a simple and easy-to-use API.

Installation

Via pip:

pip install CapSpot

From source:

git clone https://github.com/miaohancheng/CapSpot.git
cd CapSpot
python setup.py install

Usage

from CapSpot import ImageMatcher

if __name__ == '__main__':
    matcher = ImageMatcher()
    matches = matcher.match_images('./test_pic/test1_mo.png', './test_pic/test1.png')
    matcher.display_results('./test_pic/test1.png', matches)
    print(matches)

Configuration Parameters

•	ImageMatcher class
•	sim_model_name: Name of the similarity model (ONNX format), with a default model provided.
•	det_model_name: Name of the detection model (ONNX format), with a default model provided.
•	match_images method
•	template_file: Path to the template image.
•	target_file: Path to the target image.

Model Downloads

Place the required model files (similarity_model.onnx and detection_model.onnx) in the models/ directory.

Dependencies

•	Python 3.6 or higher
•	numpy
•	opencv-python
•	Pillow
•	onnxruntime

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

•	Author: Miao HanCheng
•	Email: hanchengmiao@gmail.com

Release files for CapSpot 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CapSpot 0.1.0
File Size Uploaded
CapSpot-0.1.0.tar.gz 74.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for CapSpot 0.1.0
File Interpreter ABI Platform
CapSpot-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 148.7 MB

Release files / CapSpot-0.1.0.tar.gz

Download URL CapSpot-0.1.0.tar.gz
Size 74.4 MB
Tags Source
SHA-256 checksum
How to use checksums
2038b456d219c25445f42a258b093532a0bcebb06194c928b548685b4a4f6031
BLAKE2b-256 checksum
How to use checksums
c8524332c900bc77a4cadafc7ebfeabae13dfc05dde6c4f7e3a1ca924d60e0d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.7

Release files / CapSpot-0.1.0-py3-none-any.whl

Download URL CapSpot-0.1.0-py3-none-any.whl
Size 74.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a216fe7c45d29e89f2915c4150c3584e4824ac3e058ddef2be73bdf8bc3e2f6d
BLAKE2b-256 checksum
How to use checksums
747b25c67a6a6707ffe2f32a4c1c84ed26cfb1ba79281490ddaf6df14ed54759
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page