--- id: cnstd version: "1.2.8" license: Apache 2.0 license_treatment: permissive maintenance: active --- # cnstd — Python3 package for Chinese/English Scene Text Detection (STD), Mathematical Formula Detection (MFD), and Layout Analysis, with free pretrained models License: permissive · Maintenance: active · Downloads: 98.9K/mo ## What it is and what it does CnSTD is a Python package for detecting text and other document elements in images. It provides pre-trained models for scene text detection (STD), mathematical formula detection (MFD), and layout analysis, supporting Chinese, English, and multiple other languages. The package includes models trained on standard OCR datasets and external models from PaddleOCR, available in both PyTorch and ONNX formats. The package is typically used to locate and extract bounding boxes of text regions in images before passing them to an OCR engine for character recognition. It also detects mathematical formulas (inline and isolated) and identifies document layout elements like headers, footers, tables, and figures. Models range from lightweight mobile-optimized variants to larger, more accurate versions, and can run on CPU or GPU. Use it for: - Locate text regions in document images before feeding them to an OCR system for full text recognition - Detect and classify mathematical formulas in scientific papers or textbooks for formula extraction pipelines - Analyze document layout to identify structural elements like titles, tables, and figures for automated document parsing - Process multilingual documents with language-specific detection models for Chinese, English, or other supported languages - Deploy lightweight text detection on edge devices using MobileNet or ShuffleNet model variants ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Detects text and mathematical formulas in images using pre-trained deep learning models, supporting Chinese, English, and multiple languages with both PyTorch and ONNX backends. Yes. Active maintenance, permissive Apache 2.0 license, no known vulnerabilities, and a mature model ecosystem make this a solid choice for text detection tasks. The 20-dependency footprint is typical for ML packages. Install if you need to locate text in images before OCR or analyze document layout; skip if you only need character recognition without localization. ## Install pip install cnstd uv add cnstd poetry add cnstd ## Installing cnstd Before you install: Low installation friction with a pure Python wheel. Active maintenance with recent release (40 days old) and 794 repository stars. Depends on 20 runtime packages including PyTorch, torchvision, and computer vision libraries—a substantial but standard ML stack. License in practice: Apache 2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most production deployments. Quickstart: pip install cnstd from cnstd import CnStd std = CnStd(model_name='multi_PP-OCRv6_det_small') result = std.detect('path/to/image.jpg') Requires Python 3.8 or later. First use triggers automatic model download to ~/.cnstd directory; manual download from Hugging Face or Baidu Cloud may be needed if auto-download fails. Verify before relying: - Inference speed and accuracy metrics for different model variants under various image resolutions and hardware configurations - Memory footprint and GPU VRAM requirements for each model backend - Whether layout analysis supports document types beyond the 10 listed categories ## Package facts - License: Apache 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 98.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags scene text detection, OCR text localization, mathematical formula detection, layout analysis document, text bounding box detection, Chinese text detection, document layout recognition, ocr-detection, document-analysis, multilingual [View on SkillFed](https://skillfed.io/packages/cnstd) · [View on PyPI](https://pypi.org/project/cnstd/)