1013 Commits

Author SHA1 Message Date
Lin Manhui b03f46425e [Feat] Support PP-OCRv6 (#18104)
* Fix bugs

* Fix for python3.8

* Fix mcp server

* Optimize

* Fix bugs

* Refactor

* Fix MCP

* Bump MCP to 0.8.1

* Fix bugs

* Bump version to 0.8.2

* Fix bugs and update docs

* Update docs and fix bugs

* Fix bugs

* update pp-ocrv6

* update pp-ocrv6

# Conflicts:
#	docs/version3.x/module_usage/text_detection.md
#	docs/version3.x/module_usage/text_recognition.md
#	docs/version3.x/pipeline_usage/OCR.md
#	paddleocr/_api_client/models.py
#	paddleocr/_pipelines/ocr.py

* Bump paddleocr version

* update PP-OCRv6 docs: add model metrics, fix sizes, update language count to 50

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* update PP-OCRv6: add model metrics/sizes to docs, support az/ku languages

- Add PP-OCRv6 model precision, sizes, descriptions to doc tables
- Add OCR pipeline introduction for PP-OCRv6
- Remove az/ku from unsupported latin langs (dict covers them)
- Update language count: 48->50 (medium/small), 47->49 (tiny)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Change languages

* Bump js version

* add PP-OCRv6 English docs: algorithm doc + update model tables

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Use default model

* Update doc

* Update mcp docs

* update PP-OCRv6 algorithm docs and mkdocs nav: sync speed table with paper

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Support more params

* Fix MCP

* update READMEs and index docs: PP-OCRv5 -> PP-OCRv6 features

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update sdk

* Fix bugs

* Fix unsaved

* Bump versions

* Fix bugs

* updata readme

---------

Co-authored-by: weixin_46524038 <weixin_46524038@noreply.gitcode.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: zhangyubo0722 <zhangyubo0722@163.com>
2026-06-11 19:27:04 +08:00
学卿 6d2e6fb9c7 feat: add PP-OCRv6 detection and recognition modules (#18116) 2026-06-09 20:47:05 +08:00
Hinotobi bc8392a897 [security] fix(data): restrict TableMaster LMDB pickle loading (#17931)
* fix: restrict TableMaster LMDB pickle loading

* style(data): apply black formatting

* test: restore stubbed modules after LMDB tests

* style(data): keep LMDB imports at module top

---------

Co-authored-by: Lin Manhui <mhlin425@whu.edu.cn>
2026-05-13 16:29:36 +08:00
Hinotobi d4323720c5 [security] fix(data): restrict LaTeXOCR pickle loading (#17950)
* [security] fix(data): restrict LaTeXOCR pickle loading

* style(data): apply black formatting

* test: restore LaTeXOCR stubs after tests

---------

Co-authored-by: Lin Manhui <mhlin425@whu.edu.cn>
2026-05-13 10:43:47 +08:00
Bvicii 56165f7da6 Add Python 3.13 and 3.14 support (#17826)
* Add Python 3.13 support

- Replace distutils imports with sysconfig/shutil/logging in ultra-infer setup
- Replace pkg_resources with importlib.metadata in ultra-infer __init__
- Remove np.unicode_ usage (removed in NumPy 2.0, crashes on Python 3.13+)
- Remove dead inspect.getargspec fallback (removed in 3.11)
- Add python_requires=">=3.8" and Python 3.13 classifier to setup.py
- Update Python version badges and docs from 3.8~3.12 to 3.8~3.13
- Pin PaddlePaddle to ==3.3.0 in install docs (first version with cp313 wheels)

* CI: test Python bounds (3.8, 3.13) and revert HPI docs

- CI matrix: test lower bound (3.8) and upper bound (3.13) per reviewer
  suggestion, with version-conditional PaddlePaddle install (3.2.0 for
  cp38, 3.3.0 for cp313)
- Revert HPI docs to Python 3.8-3.12 since the package is separately
  compiled and does not yet support 3.13

* CI: add Python 3.9 to test matrix

Test 3.9 as the lower bound for PaddlePaddle 3.3.0 (cp39-cp313).

* Revert PaddlePaddle version bumps in docs due to 3.3.0 CPU inference bug

Keep Python version range updates (3.8-3.13) but revert paddlepaddle
install versions to their originals since 3.3.0 CPU native inference
has a bug for paddleocr models.

* Bump langchain-paddleocr version to 0.1.1 for Python 3.13+ support

---------

Co-authored-by: Lin Manhui <mhlin425@whu.edu.cn>
2026-03-25 11:04:53 +08:00
Harikrishna KP 925e2ed400 Fix crop_margin crash with extreme aspect ratio images (#17686)
Add bounds checking to crop_margin in GoTImgDecode, UniMERNetImgDecode,
and UniMERNetResize to handle edge cases:

- Return original image when cv2.findNonZero returns None (no text found)
- Return original image when bounding rect has zero width or height
- Return original image when cropped result would have aspect ratio > 200,
  which causes ValueError in downstream image processing

Fixes PaddlePaddle#17354

Co-authored-by: Lin Manhui <mhlin425@whu.edu.cn>
2026-02-28 11:25:55 +08:00
Daniel Tu 6f425758d1 fix: replace numpy.where with paddle.where for tensor operations in ParseQHead (#17019)
Co-authored-by: Lin Manhui <mhlin425@whu.edu.cn>
2025-12-30 14:22:20 +08:00
Ghazi-raad fa30849b01 fix: support accented characters in word segmentation for return_word… (#17201)
* fix: support accented characters in word segmentation for return_word_box

Fixes #17156

The word segmentation in get_word_info() was using [a-zA-Z0-9] regex which
only matched ASCII letters and digits. This caused words with accented
characters (ä, ö, ü, é, à, etc.) to be incorrectly split into separate
segments.

Changed to use \w with re.UNICODE flag which properly matches:
- All Unicode letter characters (including accented/diacritic characters)
- Digits from all scripts
- Excludes underscore (which \w includes but we want as splitter)

This fix enables proper word grouping for German, French, Polish, and
other languages with accented characters while maintaining backward
compatibility with existing ASCII text processing.

Example: 'Grüßen' now stays as one word instead of ['Gr', 'üß', 'en']

* fix: resolve pytest warning by using assert instead of return
2025-12-29 17:40:40 +08:00
Dhouibi Iheb 7ec94e7b46 Fix: Prevent auto-splitting of French accented words in text recognition (#16994)
* Fix: Prevent auto-splitting of French accented words in text recognition

Added support for Latin characters with diacritics (é, è, à, ç, etc.) and French contractions (n'êtes) in word grouping logic of BaseRecLabelDecode.get_word_info().

This fix ensures that French words are no longer split at accented characters during OCR text recognition.

* moved test file and fix some style errors

* fix: Move test file to tests/ directory and correct Unicode name check

- Moved test_french_accents.py to tests/ directory following project structure
- Removed invalid 'FRENCH' prefix from Unicode name check
- Unicode standard only uses 'LATIN' prefix for all Latin-based characters
- All French accented characters (é, è, à, ç, etc.) are correctly matched
- Verified with comprehensive character set including uppercase/lowercase variants

* style: Remove emojis from test file to maintain project code style
2025-12-04 19:19:52 +08:00
metax666 4464c05140 [METAX] supports paddleOCR vl in meatx (#17239)
* [METAX] supports paddleOCR VL in metax_gpu

* Fix code style

* Fix code style
2025-12-01 16:25:30 +08:00
Lin Manhui 416ea0ccee [Docs] Optimize docs for deployment of PaddleOCR-VL (#16808)
* Optimize docs for deployment of PaddleOCR-VL

* Update docs

* Fix not-using-doc-prepeocessor bug

* Update dockerfiles and docs

* Add SFT

* Fix code style

* Add PaddleOCR-VL-0.9B model into offline pipeline image

* Support Windows

* Add lower bound for paddleocr version

* Revert windows and paddle 3.2.1

* Support setting paddleocr version

* Fix typo

* Update docker image sizes

* Fix bug

* Fix doc
2025-10-29 17:26:20 +08:00
tianyuzhou668 db4b14b6bd [ILUVATAR_GPU] Support for iluvatar_gpu (#16518) 2025-10-27 17:15:41 +08:00
zhangyubo0722 8ee4a20cc6 add ar models (#16636) 2025-10-16 19:10:06 +08:00
Chris Chow 7069e78b0a fix: correct macro to replace /MD with /MT in CMakeLists.txt (#16443)
* fix: correct macro to replace /MD with /MT in CMakeLists.txt

* Fix code style
2025-09-19 18:29:10 +08:00
vui611 70e98461b2 fix: Correctly handle 'GRAY' mode in DecodeImage operator (#16123) 2025-09-18 21:24:23 +08:00
co63oc dfd8efa04f fix typos (#16374) 2025-09-15 14:59:03 +08:00
zhangyubo0722 dc75da643b fix el th dict (#16351) 2025-08-28 11:34:30 +08:00
刘维克 b1a525301e fix train.log output (#14846) (#16281)
The bug was introduced in commit e3145103 ("import encryption for aistudio & fix sync bn"),
where the following snippet:
```
try:
    import encryption  # Attempt to import the encryption module for AIStudio's encryption model

    encrypted = encryption.is_encryption_needed()
except ImportError:
    get_logger().warning("Skipping import of the encryption module.")
    encrypted = False  # Encryption is not needed if the module cannot be imported
```
caused `get_logger()` to be called too early, initializing the logger before
the training arguments were passed. As a result, the training process
skipped proper log redirection, and `train.log` was not created.

This patch replaces the warning with a simple `print()` statement,
ensuring the logger is only initialized after training args are passed.

Fixes #14846
2025-08-20 18:30:33 +08:00
zhangyubo0722 71e87f7bc4 add dicts (#16268) 2025-08-19 11:21:45 +08:00
welix 326829757f fix typo (#16262) 2025-08-18 10:40:01 +08:00
liuhongen1234567 36cecc564d fix formula dependency (#16003)
* fix formula dependency

* add comments for tokenizer warnings
2025-08-17 11:41:54 +08:00
学卿 0a8a6354f1 support ppocrv5 minor languages (#15893)
* support ppocrv5 minor languages

* fixed bugs
2025-06-28 18:58:13 +08:00
liuhongen1234567 fdb1165c3a fix doc (#15160) 2025-05-19 03:02:35 +08:00
学卿 a836921984 add ocr-det v5 model (#15123)
* add ocr detV5 model

* add ocr detV5 pretrained model link
2025-05-13 17:19:37 +08:00
liuhongen1234567 0caa3e98de add_ppformulanet_plus (#15129)
* add_ppformulanet_plus

* rename ppformulanet_l_plus2plus_l
2025-05-13 14:20:42 +08:00
zhangyubo0722 a38c087bcb add ppocr v5 (#15121)
Co-authored-by: zhangyubo0722 <zangyubo0722@163.com>
2025-05-12 21:55:26 +08:00
zhangyubo0722 0cc9870eb3 fix pdmodel to json (#15122)
Co-authored-by: zhangyubo0722 <zangyubo0722@163.com>
2025-05-12 21:22:52 +08:00
zhangyubo0722 c8eb175db5 fix pdx_model_name (#15104)
Co-authored-by: zhangyubo0722 <zangyubo0722@163.com>
2025-05-07 19:33:00 +08:00
zhangyubo0722 948d521bce uniform export format with pdx (#15086) 2025-05-07 00:24:02 +08:00
zhangyubo0722 a80d2c89e5 fix det for hpi config (#15056) 2025-04-22 16:22:00 +08:00
zhangyubo0722 5d120f8fe9 fix rec hpi config (#14905) 2025-04-20 14:46:30 +08:00
Tingquan Gao b0ce52f729 save the inference model in json format by default (#15022) 2025-04-17 20:17:34 +08:00
liuhongen1234567 1ccf688ca2 fix static train in formula (#14826) 2025-03-08 00:24:37 +08:00
zhangyubo0722 f95280d52d fix bs to 1 in trt dy shape config for some formule rec model and tabel rec models (#14807) 2025-03-06 11:34:08 +08:00
co63oc 534e66506f Fix typos in several files (#14812)
* Fix typos in several files

* Fix
2025-03-06 10:34:46 +08:00
co63oc e061055808 Fix typos (#14808) 2025-03-05 19:09:08 +08:00
zhuyipin 9e7a1f4cc1 remove usused mem in latex_ocr head (#14803)
* adapt to npu

* add device judgement
2025-03-05 11:19:15 +08:00
co63oc 78ec762aac Fix typos (#14800) 2025-03-04 14:20:13 +08:00
co63oc de12ece0aa Fix (#14798) 2025-03-04 11:04:41 +08:00
co63oc f35dfef921 Fix (#14795) 2025-03-04 09:38:37 +08:00
Wang Xin 37f44372b1 unlock albumentations version (#14746) 2025-02-25 16:30:08 +08:00
zhangyubo0722 2b7b76310b fix formula rec models hpi_config (#14739)
1. for formula rec models, the channel of input data is 1;
2. for latex_ocr_rec models, fix min/max size of dynamic shape.
2025-02-25 14:59:49 +08:00
mauryaland dc34f9b45a use the env variable PADDLE_OCR_BASE_DIR if it exists to download models (#14686)
* use the env variable PADDLE_OCR_BASE_DIR to download models

* use PADDLE_OCR_BASE_DIR env variable to download models
2025-02-15 07:44:23 +08:00
Tingquan Gao 17fff8cca4 fix dy shapes of trt for rec models (#14654) 2025-02-11 11:17:23 +08:00
liuhongen1234567 2c0c4beb06 repair bleu score computation (#14626) 2025-02-06 16:02:59 +08:00
Thanajade Dechananthachai c685537e64 Add Thai character dictionary for OCR recognition (#14620)
* Add Thai character dictionary for OCR recognition

* Update Thai character dictionary with empty new line at end of file
2025-02-05 16:09:49 +08:00
liuhongen1234567 cf4c0591ba repair bug in latexocr cpu infer and typo (#14552) 2025-01-16 15:56:13 +08:00
Liu Jiaxuan 52bc8f0eab fix slanext export bug (#14519)
* add slanext models

* refine codes

* refine codes

* refine codes

* fix export SLANeXt

* fix export bugs
2025-01-09 11:49:23 +08:00
zhangyubo0722 bf2b73f0f0 add version control for export and modify hpi config (#14513) 2025-01-08 17:29:52 +08:00
Liu Jiaxuan a6b96bbfb1 fix SLANeXt export bug (#14512)
* add slanext models

* refine codes

* refine codes

* refine codes

* fix export SLANeXt
2025-01-07 19:21:34 +08:00