whatisgithub

What is captcha-ocr-trainer?

dizlexic/captcha-ocr-trainer — explained in plain English

Analysis updated 2026-05-18

1PythonAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A Python toolkit that trains a CRNN model to read and decode distorted CAPTCHA text from images, exporting it as a portable ONNX file.

Mindmap

mindmap
  root((repo))
    What it does
      Trains CRNN model
      Reads CAPTCHA text
      Exports to ONNX
    Tech stack
      Python
      PyTorch
      ONNX Runtime
    Use cases
      Solve CAPTCHAs
      Batch dataset training
      Model validation
    Audience
      Developers
      ML engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Train a custom OCR model to automatically solve four character CAPTCHA challenges.

USE CASE 2

Convert CAPTCHA images and labels into a deployable ONNX model for fast inference.

USE CASE 3

Test and validate a trained CAPTCHA model against a labeled dataset.

What is it built with?

PythonPyTorchONNXONNX Runtime

How does it compare?

dizlexic/captcha-ocr-trainera-bissell/unleash-liteabhiinnovates/whatsapp-hr-assistant
Stars111
LanguagePythonPythonPython
Setup difficultymoderatehardhard
Complexity3/54/53/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Python 3.10+ and your own labeled CAPTCHA image dataset.

So what is it?

Captcha OCR Trainer is a Python toolkit for training an AI model that reads distorted text from images, specifically targeting the short scrambled-character sequences used in CAPTCHAs. It produces a trained model you can then use to automatically decode those challenge images. The model architecture is called CRNN, a Convolutional Recurrent Neural Network. The convolutional portion extracts visual features from the image, a BiLSTM layer handles the character sequence, and a technique called CTC Loss guides training without needing exact character positions marked in the data. The training code is written in PyTorch, and training is tuned for recognising sequences of four distorted characters. To train the model you place your CAPTCHA images in a folder and create a label file (labels.jsonl) that maps each filename to its correct text string, along with a verification flag. Running the training script loads that dataset, trains for a configurable number of epochs, and exports the finished model as an ONNX file. ONNX (Open Neural Network Exchange) is a portable format that lets you run the model using ONNX Runtime, a fast inference engine, without needing PyTorch installed in production. The training script accepts flags to set the number of epochs and the minimum and maximum character length. A separate test script lets you verify the trained model by feeding it a single image or pointing it at an entire dataset directory, and it compares predictions against your labels. Requires Python 3.10 or higher.

Copy-paste prompts

Prompt 1
Help me set up a labels.jsonl file for my CAPTCHA images to use with captcha-ocr-trainer.
Prompt 2
Explain how the CRNN and CTC loss training process works in this repo so I can tune the number of epochs.
Prompt 3
Show me how to run the test script against a folder of CAPTCHA images to check my trained model's accuracy.
Prompt 4
Walk me through exporting my trained model to ONNX and running it with ONNX Runtime in production.

Frequently asked questions

What is captcha-ocr-trainer?

A Python toolkit that trains a CRNN model to read and decode distorted CAPTCHA text from images, exporting it as a portable ONNX file.

What language is captcha-ocr-trainer written in?

Mainly Python. The stack also includes Python, PyTorch, ONNX.

How hard is captcha-ocr-trainer to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is captcha-ocr-trainer for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.