Practical overview
When it fits
Use it when you need code examples and training approaches for image CAPTCHA recognition and can prepare or work with the required images and labels. The README advises first considering whether the challenge can instead be avoided or its possible answers enumerated.
Who it is for
- Developers experimenting with image CAPTCHA recognition in controlled datasets
- Practitioners preparing labeled images to train text or object-detection models
- Python users comparing template matching, OCR and deep-learning approaches for different image challenges
Documented uses
- Train a fixed-length text CAPTCHA recognizer from labeled images.
- Predict text from a local image, image bytes or a remote image URL.
- Explore slider-gap detection with OpenCV template matching or a YOLOv5 model.
- Develop recognition workflows for rotation, point-and-select text or similar-object challenges.
Requirements & limits
The repository is public and identified as open source under the Apache-2.0 license.
- Fixed-length text training requires separate configured training and validation directories, consistent image dimensions and a specified filename pattern.
- The README points to requirements.txt for Python dependencies.
- The slider YOLOv5 workflow requires labeled data and training; a template-matching approach is also described.
- For similar-object training, the README recommends at least 200 labeled images and reports errors in its 300-image example.
- The repository is code and examples, not a hosted CAPTCHA-recognition service.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Prepare and train a fixed-length text CAPTCHA model
Train the repository's fixed-length text CAPTCHA example using a configured training and validation dataset.
Before you start
- Python environment with dependencies selected from requirements.txt
- Training and validation image directories specified in the configuration
- Images with consistent dimensions, named as CAPTCHA text, underscore, identifier and image extension
- The default configuration file is fixed_length_captcha.json
Steps
Place training and validation images in their configured directories.
Set the configuration fields for the dataset and training workflow.
Run the command below.
python fixed_length_captcha.py
Expected outcome
The script trains the fixed-length text CAPTCHA model; the README also describes predictor methods for local files, image bytes and remote image URLs.
Guide limitations
- Results depend on the training data and sample count; the README's reported accuracy applies to its example, not all datasets.
- The guide covers training and documented prediction interfaces, not deployment or integration into another service.
Train a YOLOv5 slider-gap detector
Train the documented YOLOv5 approach for locating displacement in slider CAPTCHA images.
Before you start
- Labeled slider CAPTCHA data; the repository includes 100 labeled images for its example
- The YOLOv5 project and its custom-data training setup
- Training parameters including batch size, epochs, image size, data configuration and model configuration
Steps
Prepare labeled data and configure the YOLOv5 custom-data training files.
Adjust batch size, epochs and image size for the available memory and image dimensions.
Run the documented training command: the command below.
python train.py --batch-size 4 --epochs 200 --img 344 --data displacement.yaml --weights '' --cfg yolov5s.yamlLoad the resulting model with
slide_captcha.DisplacementFinderByYolo()and calldetect_displacementon an image.
Expected outcome
A trained model can be loaded by the repository's slider detector to identify displacement in an input image.
Guide limitations
- Training requires labeled data and the README directs readers to YOLOv5's custom-data training guidance.
- The README gives example parameters; batch size, epochs and image size may need adjustment.
- This documents a model-use workflow, not a production deployment or accuracy guarantee.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 19 November 2026
- Original website title
- anexplore/cnn_for_captcha · Official homepage title · retained in its source language

