Skip to main content

Classical image-processing digit-CAPTCHA solver (no ML, no GPU needed). C++ backend + Python shell.

Project description

CaptchaConda

머신러닝 없이 고전 이미지 처리만으로 숫자 캡챠를 푸는 솔버. 학습 데이터도, GPU도, 프레임워크도 필요 없다. 매칭 코어는 C++ 백엔드로 이식돼 있고, Python은 얇은 껍데기 (전처리·세그멘테이션·오케스트레이션)로 남는다. 각 환경에 맞는 백엔드는 설치 후 한 번만 빌드한다.

설치

pip install CaptchaConda
python -m CaptchaConda init          # 이 환경에 맞게 C++ 백엔드 빌드 (CPU)
# 또는 GPU 환경:
python -m CaptchaConda init --cuda   # nvcc 로 CUDA 백엔드 빌드

init은 로컬 컴파일러(c++ 또는 nvcc)로 백엔드를 빌드한다. 컴파일러가 없으면 순수 Python 폴백으로 자동 전환된다(동일 결과, 조금 느림).

사용

from CaptchaConda import CaptchaConda

device = "cuda"  # 또는 "cpu"
cc = CaptchaConda(devices=device)   # 처음 1회만
cc.init()                            # 처음 1회만 (백엔드 빌드+로드)

print(cc.solve("captcha.png"))       # -> "39825"
print(cc.solve(pil_image, expected_n=5))
  • CaptchaConda(devices="cpu"|"cuda") — 백엔드 종류 선택
  • init(force=False) — 백엔드 빌드/로드(캐시됨; force=True로 재빌드)
  • solve(image, expected_n=None) — 이미지(경로 또는 PIL) → 숫자 문자열

왜 이런 구조인가

  • Python은 그대로 배포 → 이식성. 무거운 계산은 C++ 백엔드가 담당.
  • 백엔드는 소스로 배포되고 init 때 각 환경에 맞게 컴파일 → 배포 바이너리 호환성 문제를 피하고, CUDA가 있으면 GPU 백엔드로 빌드.
  • 학습이 없으므로 모델 파일·GPU·데이터셋 비용이 0. 필터 데이터(수십 KB)만 동봉.

동작 개요

이미지 → 배경 분리 → 숫자 분리 → (C++) 필터 매칭 + 위상 라우팅 + 이중필터 → 시퀀스. 정확도는 타깃 캡챠 분포에 맞춰 동봉 필터를 튜닝할수록 올라간다.

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

captchaconda-0.1.0.tar.gz (86.5 kB view details)

Uploaded Source

Built Distribution

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

captchaconda-0.1.0-py3-none-any.whl (87.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: captchaconda-0.1.0.tar.gz
  • Upload date:
  • Size: 86.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for captchaconda-0.1.0.tar.gz
Algorithm Hash digest
SHA256 89056d35273a7a79848c25ec515c8cb9ad30f6e20351e4d1184e5c6e3125612b
MD5 bb1b90f9639ab4fc92bad9166bb3db6c
BLAKE2b-256 3cc1aa62e33f46596f479865e6c1fee2ab7cba241efd72c71ece3d2e4a53e232

See more details on using hashes here.

File details

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

File metadata

  • Download URL: captchaconda-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 87.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for captchaconda-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc2fc0d876568cea29f1cabe6b3dcbc7e292dda0e789b03f2785bc875f8c40f0
MD5 bb3abe7c99a2cd7699c7314478d9d871
BLAKE2b-256 09d23daf50ded78d52d42f8af3a104904fa87fef1e9ce3f25fd897db11ec11df

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