# PP-OCRv6 Board Demo Dual Executables

This package builds two executables with one `build.sh`.

## Output executables

```text
Release/test-rknn-model-smoke
Release/test-ppocrv6-ocr
```

They are copied to:

```text
$SYSROOT/userdata/ppocrv6_ocr_demo/bin/
```

## Files

```text
build.sh
CMakeLists.txt
src/rknn_model_smoke_test.cc
src/ppocrv6_ocr_demo.cc
README.md
```

## Important

Do not copy `librknnrt.so` into the demo directory.

Runtime should use the board system library:

```text
/usr/lib/librknnrt.so
/usr/lib/librknn_api.so
```

## Build

```bash
cd ppocrv6_board_demo

./build.sh
```

If needed:

```bash
CXX=arm-linux-gnueabihf-g++ ./build.sh
```

or:

```bash
CXX=arm-rockchip830-linux-uclibcgnueabihf-g++ ./build.sh
```

## Clean

```bash
./build.sh clear
```

## Smoke test on board

```bash
cd /userdata/ppocrv6_ocr_demo

./bin/test-rknn-model-smoke \
  ./model/ppocrv6_small_det_rv1126b_i8.rknn

./bin/test-rknn-model-smoke \
  ./model/ppocrv6_small_rec_rv1126b_fp_no_softmax.rknn
```

## OCR test on board

```bash
cd /userdata/ppocrv6_ocr_demo

./bin/test-ppocrv6-ocr \
  ./model/ppocrv6_small_det_rv1126b_i8.rknn \
  ./model/ppocrv6_small_rec_rv1126b_fp_no_softmax.rknn \
  ./dict/ppocrv6_rec_dict.txt \
  ./test/jp_001.jpg \
  ./test
```

Output:

```text
./test/ocr_result.txt
./test/ocr_result.jpg
./test/crops/
```

## Note

`test-ppocrv6-ocr` is a v0.1 end-to-end validation demo.
The detection postprocess is simplified and should later be replaced with full PaddleOCR DB postprocess.


## v2 update

This version searches OpenCV libraries under Debian multiarch paths:

```text
$SYSROOT/usr/lib/aarch64-linux-gnu
$SYSROOT/lib/aarch64-linux-gnu
```

This matches the current RV1126B rootfs where OpenCV 4.5 libraries are located.
