Files
FastDeploy/examples/vision/ocr/PP-OCRv3/web
Double_V 0a22979c35 [Model] add Paddle.js web demo (#392)
* add application include paddle.js web demo and xcx

* cp PR #5

* add readme

* fix comments and link

* fix xcx readme

* fix Task 1

* fix bugs

* refine readme

* delete ocrxcx readme

* refine readme

* fix bugs

* delete old readme

* 200px to 300px

* revert 200px to 300px

Co-authored-by: Jason <jiangjiajun@baidu.com>
2022-10-20 17:01:38 +08:00
..

PP-OCRv3 前端部署示例

本节介绍部署PaddleOCR的PP-OCRv3模型在浏览器中运行以及@paddle-js-models/ocr npm包中的js接口。

前端部署PP-OCRv3模型

PP-OCRv3模型web demo使用参考文档

PP-OCRv3 js接口

import * as ocr from "@paddle-js-models/ocr";
await ocr.init(detConfig, recConfig);
const res = await ocr.recognize(img, option, postConfig);

ocr模型加载和初始化其中模型为Paddle.js模型格式js模型转换方式参考文档

init函数参数

recognize函数参数

  • img(HTMLImageElement): 输入图像参数类型为HTMLImageElement。
  • option(dict): 可视化文本检测框的canvas参数可不用设置。
  • postConfig(dict): 文本检测后处理参数,默认值为:{shape: 960, thresh: 0.3, box_thresh: 0.6, unclip_ratio:1.5}; thresh是输出预测图的二值化阈值box_thresh是输出框的阈值低于此值的预测框会被丢弃unclip_ratio是输出框扩大的比例。

其它文档