gitmyhub

chineseocr_lite

C++ ★ 12k updated 1mo ago

超轻量级中文ocr,支持竖排文字识别, 支持ncnn、mnn、tnn推理 ( dbnet(1.8M) + crnn(2.5M) + anglenet(378KB)) 总模型仅4.7M

A lightweight OCR tool that reads Chinese (and other) text from images using three tiny AI models totalling under 5 MB, fast enough to run on phones and low-powered devices without a GPU.

PythonC++ONNXNCNNMNNJavaKotlinsetup: moderatecomplexity 3/5

ChineseOCR Lite is a lightweight tool for reading text out of images, with a focus on Chinese characters. OCR stands for optical character recognition, which means converting a photo or scan of printed text into actual text a computer can work with. This project is built to be small and fast: the three AI models it uses add up to only about 4.7 megabytes total, so it can run on phones and low-powered devices without needing a graphics card.

The system uses three models working together. The first detects where text appears in the image. The second figures out the orientation of each detected text block. The third reads the actual characters. It can handle text written vertically as well as horizontally, which is important for Chinese content where vertical layouts are common.

The project supports several ways to run it. There is a web interface where you can upload an image and see the recognized text in a browser. There is a command-line tool that takes an image file and outputs the recognized text as JSON, which is useful for batch processing or connecting it to other programs. It also provides example code for C++, Java and Kotlin via JVM bindings, Android apps, and .NET, so developers working in different programming languages can integrate it into their own software.

The underlying models are provided in the ONNX format, a standard format for AI models, which means they can run on CPU without any special setup. For developers who need to run the models on a phone or in very constrained environments, there are also versions formatted for NCNN and MNN, which are frameworks commonly used for on-device AI in mobile apps.

Setup for the Python version is a single pip install command, and a simple web server starts with one Python command. The README is written in Chinese and the project is aimed primarily at developers working with Chinese-language text recognition tasks.

Where it fits