#18380·PaddleOCR

BGR/RGB mismatch in PP-OCRv6 Android recog preprocessing

Author: ankandrewCreated Sep 28, 2026Updated Sep 28, 2026

Search before asking

  • I have searched the PaddleOCR Docs and found no similar bug report.
  • I have searched the PaddleOCR Issues and found no similar bug report.
  • I have searched the PaddleOCR Discussions and found no similar bug report.

Bug (问题描述)

Seems PP-OCRv6 recognition is trained/evaluated with BGR images, but Android ONNX preprocessing converts BGR to RGB...

‍♂️ Environment (运行环境)

Latest PaddleOCR main, PP-OCRv6 ONNX models.

Minimal Reproducible Example (最小可复现问题的Demo)

PP-OCRv6 training config uses BGR:

https://github.com/PaddlePaddle/PaddleOCR/blob/dab3fe35379033fdcb2d0e9572fac0b36c9a9ebf/configs/rec/PP-OCRv6/PP-OCRv6_small_rec.yml#L84-L85

Android ONNX preprocessing converts BGR to RGB:

https://github.com/PaddlePaddle/PaddleOCR/blob/dab3fe35379033fdcb2d0e9572fac0b36c9a9ebf/deploy/ppocr-android/ppocr-sdk/src/main/java/com/paddle/ocr/preprocess/RecPreprocessor.kt#L38-L39

so training pipeline uses BGR, while the Android recog preprocessing converts the crop to RGB before inference.