Skip to main content

EasyOCR Example

This document describes how to use the QAI AppBuilder Python API to run inference with the EasyOCR text recognition model on Qualcomm® Hexagon™ Processor (NPU).

Supported Devices

DeviceSoC
Fogwise® AIRbox Q900QCS9075

Install QAI AppBuilder

tip
  1. Please install QAI AppBuilder according to the QAI AppBuilder Installation Guide.

  2. Configure ADSP environment variables as described in Create ADSP Environment Variables.

Run the Example

Install Dependencies

Device
pip3 install requests tqdm qai-hub py3_wget opencv-python torch torchvision matplotlib easyocr qai_hub_models

Run the Script

  • Navigate to the example directory

    Device
    cd ai-engine-direct-helper/samples/python
  • Prepare input image. The following image is used as an example:

    input image

  • Run inference

    Device
    python3 easy_ocr/easy_ocr.py
    $ python3 easy_ocr/easy_ocr.py
    /prj/qct/webtech_scratch20/mlg_user_admin/qaisw_source_repo/rel/qairt-2.37.1/point_release/SNPE_SRC/avante-tools/prebuilt/dsp/hexagon-sdk-5.5.5/ipc/fastrpc/rpcmem/src/rpcmem_android.c:38:dummy call to rpcmem_init, rpcmem APIs will be used from libxdsprpc
    Calling EasyOCR_Detector::Inference on NPU
    Calling EasyOCR_Recognizer::Inference on NPU
    Calling EasyOCR_Recognizer::Inference on NPU
    Calling EasyOCR_Recognizer::Inference on NPU
    Calling EasyOCR_Recognizer::Inference on NPU
    Calling EasyOCR_Recognizer::Inference on NPU
    Calling EasyOCR_Recognizer::Inference on NPU
    Calling EasyOCR_Recognizer::Inference on NPU
    Calling EasyOCR_Recognizer::Inference on NPU
    白日依山尽
    黄河入海流
    欲穷千里目
    更上一层楼
    The sun beyond the mountain glows,
    The Yellow River seawards flows_
    You can enjoy a grander sight,
    By climbing to a greater height。

    Demo image display is disabled by default for remote servers. To override, set `QAIHM_ALWAYS_DISPLAY_OUTPUT=1` in your environment.

    Saving image to /mnt/ssd/qualcomm/702/zzf_fork/test/ai-engine-direct-helper/samples/python/build/image.png
    <W> Logs will be sent to the system's default channel
    /prj/qct/webtech_scratch20/mlg_user_admin/qaisw_source_repo/rel/qairt-2.37.1/point_release/SNPE_SRC/avante-tools/prebuilt/dsp/hexagon-sdk-5.5.5/ipc/fastrpc/rpcmem/src/rpcmem_android.c:42:dummy call to rpcmem_deinit, rpcmem APIs will be used from libxdsprpc

    Recognition results

    白日依山尽
    黄河入海流
    欲穷千里目
    更上一层楼
    The sun beyond the mountain glows,
    The Yellow River seawards flows_
    You can enjoy a grander sight,
    By climbing to a greater height。

    You need to be logged into GitHub to post a comment. If you are already logged in, please ignore this message.

    Radxa-docs © 2026 by Radxa Computer (Shenzhen) Co.,Ltd. is licensed under CC BY 4.0