Skip to content

Feature Request: Support for Arabic Language (PaddleOCR v5 Multilingual) #20

Description

@amryounis

Description
Currently, mobile_ocr provides excellent support for Latin-based scripts on Android (via PaddleOCR v5) and iOS (via Vision). However, there is no built-in way to perform OCR on Arabic text. Since the plugin is already using PaddleOCR v5 for Android, adding Arabic support would likely involve exposing a configuration to load the multilingual models and handling RTL text reordering.

Current Behavior

Passing an image with Arabic text to detectText fails to recognize Arabic characters or returns empty blocks because the default recognition model is Latin/English-only.

There is no parameter in the current API to specify the language/model path for different scripts.

Requested Feature

Model Configuration: Allow users to specify a language code (e.g., lang: 'ar') or provide custom paths for detection/recognition .onnx models and the .txt character map.

Arabic Character Support: Ensure the bundled or downloadable Android models include the arabic_PP-OCRv5_mobile_rec weights.

RTL Logic: Implement post-processing logic to handle Right-to-Left character shaping and reading order. Arabic text often appears reversed in standard OCR output without bidi (bi-directional) processing.

Proposed Implementation (Android)
Since the plugin uses ONNX Runtime, the setup method could be expanded to allow:

Dart
await _ocr.setup(
language: 'ar',
// or
customModelPath: 'assets/models/arabic_v5_rec.onnx',
customKeyPath: 'assets/models/arabic_dict.txt'
);
Additional Context
Arabic receipts and documents are a major use case for mobile OCR. Standard PaddleOCR already supports Arabic with high accuracy (approx. 81%+), so this would primarily be a bridging task for the Flutter plugin.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions