PP-OCRv6-Small Deployment
Introduction
PP-OCRv6-Small is the sixth-generation ultra-lightweight text recognition model released by Baidu PaddlePaddle. Built on the classic "detection-classification-recognition" three-stage pipeline, it deeply integrates the latest lightweight Vision Transformer (ViT) operators with dynamic adaptive feature alignment techniques. By aggressively pruning the backbone network and reconstructing its parameters, PP-OCRv6-Small significantly addresses the pain points of recognizing tilted text, stylized fonts, and extreme text in industrial scenarios such as reflective and low-light environments, without sacrificing inference speed. The model natively supports operator-level efficient quantization and hardware-level parallelism. It is compact and highly throughput-oriented, making it a brand-new tool for achieving local high-precision, low-latency text structured extraction on AIoT edge computing platforms such as smart cameras, edge computing gateways, and smart logistics handheld terminals.
This chapter demonstrates how to perform PP-OCRv6-Small deployment, loading, and recognition on edge devices. The following deployment method is provided:
- AidLite Python API
In this case, model inference runs on the device-side NPU computing unit, and the relevant interfaces are called through code to receive user input and return results.
- Device: Rhino Pi-X1
- System: Ubuntu 22.04
- Source model: PP-OCRv6-Small
- Quantized model precision: FP16 quantization
- Model Farm Reference: PP-OCRv6-Small
Supported Platforms
| Platform | Running Method |
|---|---|
| Rhino Pi-X1 | Ubuntu 22.04, AidLux |
Preparation
- Rhino Pi-X1 hardware
- Ubuntu 22.04 system or AidLux system
Download the PP-OCRv6-Small Model Resources
mms list PP-OCRv6-Small
#------------------------ You can see the PP-OCRv6-Small model ------------------------
Model Precision Chipset SOC Backend
-------------- --------- ------- ---------------- -------
PP-OCRv6-Small FP16 qcs8550 Qualcomm QCS8550 QNN2.40
# Download PP-OCRv6-Small
mms get -m PP-OCRv6-Small -p fp16 -c qcs8550 -b qnn2.40 -d /home/aidlux/models-test
cd /home/aidlux/models-test
# Unzip
unzip PaddleOCR-V6-Small_qcs8550_fp16.zipInstall the AidLite SDK
Developers can also refer to the README.md in the model folder to install the SDK.
- Ensure the QNN backend version is
≥ 2.40 - Ensure
aidlite-sdkandaidlite-qnnxxxversions are2.4.xor higher
# Check AidLite & QNN versions
dpkg -l | grep aidlite
#------------------------ The output is similar to the following ------------------------
ii aidlite-qnn240 2.4.1.271 arm64 aidlux aidlite qnn240 backend plugin
ii aidlite-sdk 2.4.1.271 arm64 aidlux inference module sdkUpdate QNN & AidLite versions:
# Install AidLite SDK
sudo aid-pkg update
sudo aid-pkg install aidlite-sdk
sudo aid-pkg install aidlite-qnn240
# aidlite sdk c++ check
python3 -c "import aidlite; print(aidlite.get_library_version())"
# aidlite sdk python check
python3 -c "import aidlite; print(aidlite.get_py_library_version())"AidLite Python API Deployment
Run the Python API example
cd /home/aidlux/models-test/code
python3 python/ppocrv6_small_infer.py python/image.jpg --det_qnn_model ../models/QCS8550/FP16/small_det_inference_fix_qcs8550_fp16.qnn236.ctx.bin.aidem --rec_qnn_model ../models/QCS8550/FP16/small_rec_inference_fix_qcs8550_fp16.qnn236.ctx.bin.aidem --json-out ocr.json --vis-out ocr.pngYou can see the model inference time (in ms) and detection results in the command line:
Current detection input shape: (1, 3, 480, 480)
Current recognition input shape: (1, 3, 48, 320)
Current det QNN model: ../models/QCS8550/FP16/small_det_inference_fix_qcs8550_fp16.qnn236.ctx.bin.aidem
Current rec QNN model: ../models/QCS8550/FP16/small_rec_inference_fix_qcs8550_fp16.qnn236.ctx.bin.aidem
[2026-07-07 17:05:14.249] [info] [license.cpp:650] the device is licensed, with license ID: aidd0c48cbed7a263eb5ff7764b4dfea235
python3 I 4155044 4155044 BufferAllocator.cpp:100] Using DMA-BUF heap named: system
/prj/qct/webtech_scratch20/mlg_user_admin/qaisw_source_repo/rel/qairt-2.40.0/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
[2026-07-07 17:05:14.429] [info] [license.cpp:650] the device is licensed, with license ID: aidd0c48cbed7a263eb5ff7764b4dfea235
PluginManager::load_plugin(): plugin(=aidlite_qnn240) has been loaded
Current yml_path: ../models/QCS8550/FP16/inference.yml
det qnn invoke: 5.737ms
DB unclip backend: pyclipper/shapely
/prj/qct/webtech_scratch20/mlg_user_admin/qaisw_source_repo/rel/qairt-2.40.0/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
Timing(ms): det_preprocess=10.033, det=9.963, det_postprocess=4.137, rec_preprocess=1.303, rec=54.115, rec_postprocess=3.164, total=107.735After the example program runs, the ocr.json and ocr.png files will be generated in the current working directory /home/aidlux/models-test/code.