ms-types 0.0.31 → 0.0.33
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 +1 -1
- package/types/paddleOcr.d.ts +33 -3
- package/types/yolo.d.ts +2 -4
package/package.json
CHANGED
package/types/paddleOcr.d.ts
CHANGED
|
@@ -2,17 +2,47 @@
|
|
|
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
|
-
* @param
|
|
37
|
+
* @param maxSideLen 最大边长,默认2000,可不传
|
|
8
38
|
* @returns 初始化是否成功
|
|
9
39
|
* @example
|
|
10
|
-
* const loaded = paddleOcr.loadV5(
|
|
40
|
+
* const loaded = paddleOcr.loadV5(2000)
|
|
11
41
|
* if (loaded) {
|
|
12
42
|
* logger.info("加载成功")
|
|
13
43
|
* }
|
|
14
44
|
*/
|
|
15
|
-
function loadV5(
|
|
45
|
+
function loadV5(maxSideLen?: number): boolean;
|
|
16
46
|
/**
|
|
17
47
|
* 执行OCR识别
|
|
18
48
|
* @param input 输入源(imageId、URL字符串、文件路径或"screen","screen"表示使用当前屏幕)
|
package/types/yolo.d.ts
CHANGED
|
@@ -53,16 +53,14 @@ declare namespace yolo {
|
|
|
53
53
|
* @param paramPath ncnn模型的param文件的绝对路径
|
|
54
54
|
* @param binPath ncnn模型的bin文件绝对路径
|
|
55
55
|
* @param nc 模型的标签数量,可在标签集data.yaml中看到
|
|
56
|
-
* @param useGpu 是否启动gpu,默认用cpu
|
|
57
56
|
* @returns 加载成功返回模型ID字符串,失败返回null
|
|
58
57
|
* @example
|
|
59
|
-
* const modelId = yolo.loadV11("yolov11n.param", "yolov11n.bin", 80
|
|
58
|
+
* const modelId = yolo.loadV11("yolov11n.param", "yolov11n.bin", 80)
|
|
60
59
|
*/
|
|
61
60
|
function loadV11(
|
|
62
61
|
paramPath: string,
|
|
63
62
|
binPath: string,
|
|
64
|
-
nc: number
|
|
65
|
-
useGpu: boolean
|
|
63
|
+
nc: number
|
|
66
64
|
): string | null;
|
|
67
65
|
|
|
68
66
|
/**
|