Skip to content

About

Оффлайн решение captcha

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

@fennr/captcha-recognizer

Offline captcha Recognizer for Node.js. Runs a bundled ONNX model in-process — not a third-party captcha-solving API.

Русская версия

Supported captcha

This package targets one fixed image class (noise, gradient, crossing line) — not reCAPTCHA or arbitrary OCR.

Example captcha

ChallengeText for the sample above: 43wpp (exactly 5 characters from [a-z0-9]).

Install

npm install @fennr/captcha-recognizer

Requires Node.js ≥ 20. Pulls native dependencies (onnxruntime-node, sharp).

Short alias (optional)

Install under a short local name without publishing a second package:

npm install fcr@npm:@fennr/captcha-recognizer
import { recognize, createRecognizer } from "fcr";

Usage

import { readFile } from "node:fs/promises";
import { recognize, createRecognizer } from "@fennr/captcha-recognizer";

// one-shot
const text = await recognize(await readFile("captcha.png"));
console.log(text); // e.g. "43wpp"

// reuse a session
const recognizer = await createRecognizer();
try {
  const again = await recognizer.recognize(await readFile("captcha.png"));
  console.log(again);
} finally {
  await recognizer.dispose();
}

CLI (after build / from the repo):

npm run build
npm run recognize -- path/to/image.png

Scope and limits

  • Tuned for one fixed captcha image class (see sample above).
  • Expected text: exactly 5 characters from [a-z0-9].
  • Not a general-purpose OCR engine.
  • Not a hosted solving service — everything runs locally with the shipped model.

Invalid or unrecognized output raises RecognitionError.

Model attribution

Weights are derived from the public Keras captcha-recognition approach documented in krishnatherokar/captcha-recognition on Kaggle, exported to models/captcha.onnx for ONNX Runtime.

License

MIT — see LICENSE.

About

Оффлайн решение captcha

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages