Skip to main content

An image matching package using ONNX models

Project description

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

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

CapSpot-0.1.0.tar.gz (74.4 MB view details)

Uploaded Source

Built Distribution

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

CapSpot-0.1.0-py3-none-any.whl (74.4 MB view details)

Uploaded Python 3

File details

Details for the file CapSpot-0.1.0.tar.gz.

File metadata

  • Download URL: CapSpot-0.1.0.tar.gz
  • Upload date:
  • Size: 74.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.7

File hashes

Hashes for CapSpot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2038b456d219c25445f42a258b093532a0bcebb06194c928b548685b4a4f6031
MD5 ca4bb4cbd546b838bf209bb79c36bcaa
BLAKE2b-256 c8524332c900bc77a4cadafc7ebfeabae13dfc05dde6c4f7e3a1ca924d60e0d8

See more details on using hashes here.

File details

Details for the file CapSpot-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: CapSpot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 74.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.7

File hashes

Hashes for CapSpot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a216fe7c45d29e89f2915c4150c3584e4824ac3e058ddef2be73bdf8bc3e2f6d
MD5 d6f31741f7d64b3f898cb8e4dcc34057
BLAKE2b-256 747b25c67a6a6707ffe2f32a4c1c84ed26cfb1ba79281490ddaf6df14ed54759

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