{"id":44583,"library":"cnocr","title":"CnOcr","description":"CnOcr is a Python 3 package for Chinese and English OCR, providing small pretrained models. Version 2.3.2.3 is the latest release. The library uses ONNX for inference and supports both text detection and recognition. Release cadence is irregular.","status":"active","version":"2.3.2.3","language":"python","source_language":"en","source_url":"https://github.com/breezedeus/cnocr","tags":["ocr","chinese-ocr","deep-learning"],"install":[{"cmd":"pip install cnocr","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for model inference (ONNX runtime fallback).","package":"torch","optional":true}],"imports":[{"note":"","wrong":"","symbol":"CnOcr","correct":"from cnocr import CnOcr"}],"quickstart":{"code":"from cnocr import CnOcr\n\nocr = CnOcr()\nresult = ocr.ocr('path/to/image.jpg')\nfor item in result:\n    print(item['text'])","lang":"python","description":"Initialize CnOcr with default model and OCR an image."},"warnings":[{"fix":"Use 'from cnocr import CnOcr'.","message":"Version 2.x changed the API from cnocr.CnOcr to directly importing CnOcr class. Old import 'import cnocr' and using cnocr.CnOcr() still works but is deprecated.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Set model name or download models manually.","message":"Models are downloaded on first run (~50MB). Ensure internet connection or set the model path explicitly using model_name parameter.","severity":"gotcha","affected_versions":"all"},{"fix":"Use CnOcr.ocr() instead.","message":"The older recognition API 'CnOcr.ocr_for_single_line()' is deprecated in favor of 'ocr()' which handles both detection and recognition.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.3.2.3':18 '3':6 'cadenc':37 'chines':9,42 'chinese-ocr':41 'cnocr':1,2 'deep':45 'deep-learn':44 'detect':33 'english':11 'infer':28 'irregular':39 'latest':21 'learn':46 'librari':24 'model':16 'ocr':12,40,43 'onnx':26 'packag':7 'pretrain':15 'provid':13 'python':5 'recognit':35 'releas':22,36 'small':14 'support':30 'text':32 'use':25 'version':17","created_at":"2026-06-07T12:50:50.453387+00:00","updated_at":"2026-06-07T12:50:50.453387+00:00","problems":[{"fix":"Run 'pip install cnocr'","cause":"Package not installed.","error":"ModuleNotFoundError: No module named 'cnocr'"},{"fix":"Update cnocr with 'pip install --upgrade cnocr' and use 'ocr()' method.","cause":"Using an older version of cnocr (<2.0) where the method was named differently.","error":"AttributeError: 'CnOcr' object has no attribute 'ocr'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/breezedeus/cnocr","github":"https://github.com/breezedeus/cnocr","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}