Skip to content

Commit c757296

Browse files
Merge pull request #409 from changy1105/master
feat(paddlejs-examples): add ocr detect xcx opencv wasm
2 parents 5132940 + d08c58e commit c757296

6 files changed

Lines changed: 7119 additions & 8 deletions

File tree

packages/paddlejs-examples/ocrdetectXcx/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* [微信小程序开发者工具](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html)
1515
* 前端开发环境准备:node、npm
1616
* 小程序管理后台配置服务器域名,或打开开发者工具【不校验合法域名】
17+
1718
详情参考:https://mp.weixin.qq.com/wxamp/devprofile/get_profile?token=1132303404&lang=zh_CN)
1819

1920
### 2.2 启动步骤
@@ -36,7 +37,8 @@ cd Paddle.js/packages/paddlejs-examples/ocrdetectXcx && npm install
3637

3738
#### **5. 构建依赖**
3839
点击开发者工具中的菜单栏:工具 --> 构建 npm
39-
***原因**:node_modules 目录不会参与编译、上传和打包中,小程序想要使用 npm 包必须走一遍“构建 npm”的过程,构建完成会生成一个 miniprogram_npm 目录,里面会存放构建打包后的 npm 包,也就是小程序真正使用的 npm 包。*
40+
41+
原因:node_modules 目录不会参与编译、上传和打包中,小程序想要使用 npm 包必须走一遍“构建 npm”的过程,构建完成会生成一个 miniprogram_npm 目录,里面会存放构建打包后的 npm 包,也就是小程序真正使用的 npm 包。*
4042
[参考文档](https://developers.weixin.qq.com/miniprogram/dev/devtools/npm.html)
4143

4244
### 2.3 效果展示
@@ -76,4 +78,4 @@ wx.canvasGetImageData({
7678
```
7779

7880
## 4. 更多
79-
* [详细文档](https://mp.weixin.qq.com/s/GP1lc3FZ6lQyD7FJfU67xw)
81+
* [详细文档](https://mp.weixin.qq.com/s/KBjXawSfBreUCsIYbUgF-w)

packages/paddlejs-examples/ocrdetectXcx/pages/index/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import { divide, enableBoundaryChecking, plus } from 'number-precision';
66
// eslint-disable-next-line no-undef
77
const plugin = requirePlugin('paddlejs-plugin');
88
const Polygon = require('d3-polygon');
9-
const CV = require('./opencv');
9+
10+
global.wasm_url = 'pages/index/wasm/opencv_js.wasm.br';
11+
const CV = require('./wasm/opencv.js');
1012

1113
plugin.register(paddlejs, wx);
1214

packages/paddlejs-examples/ocrdetectXcx/pages/index/opencv.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)