* 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>
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>
* 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
* 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
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