ms-types 0.0.32 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/types/paddleOcr.d.ts +31 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ms-types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"docs:preview": "vitepress preview docs"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"vitepress": "^1.0.0"
|
|
18
|
+
"vitepress": "^1.0.0",
|
|
19
|
+
"vitepress-theme-teek": "^1.4.5"
|
|
19
20
|
}
|
|
20
21
|
}
|
package/types/paddleOcr.d.ts
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
2
2
|
* 飞桨OCR模块 包含OCR识别、OCR模型加载等功能
|
|
3
3
|
*/
|
|
4
4
|
declare namespace paddleOcr {
|
|
5
|
+
/**
|
|
6
|
+
* OCR识别结果接口
|
|
7
|
+
*/
|
|
8
|
+
interface OCRResult {
|
|
9
|
+
/** 识别的文本内容 */
|
|
10
|
+
text: string;
|
|
11
|
+
/** 识别置信度 (0-1) */
|
|
12
|
+
confidence: number;
|
|
13
|
+
/** 文本区域左上角 x 坐标 */
|
|
14
|
+
x: number;
|
|
15
|
+
/** 文本区域左上角 y 坐标 */
|
|
16
|
+
y: number;
|
|
17
|
+
/** 文本区域右下角 x 坐标 */
|
|
18
|
+
ex: number;
|
|
19
|
+
/** 文本区域右下角 y 坐标 */
|
|
20
|
+
ey: number;
|
|
21
|
+
/** 文本区域宽度 */
|
|
22
|
+
width: number;
|
|
23
|
+
/** 文本区域高度 */
|
|
24
|
+
height: number;
|
|
25
|
+
/** 文本区域中心点 x 坐标 */
|
|
26
|
+
centerX: number;
|
|
27
|
+
/** 文本区域中心点 y 坐标 */
|
|
28
|
+
centerY: number;
|
|
29
|
+
/** 文本区域角度 */
|
|
30
|
+
angle: number;
|
|
31
|
+
/** 文本区域方向 0 横向 1 竖向 */
|
|
32
|
+
orientation: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
5
35
|
/**
|
|
6
36
|
* 初始化PP-OCRv5模型
|
|
7
37
|
* @param maxSideLen 最大边长,默认2000,可不传
|
|
@@ -33,7 +63,7 @@ declare namespace paddleOcr {
|
|
|
33
63
|
y: number,
|
|
34
64
|
ex: number,
|
|
35
65
|
ey: number
|
|
36
|
-
):
|
|
66
|
+
): OCRResult[];
|
|
37
67
|
/**
|
|
38
68
|
* 释放OCR模型资源
|
|
39
69
|
*/
|