ms-types 0.0.30 → 0.0.32

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-types",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -73,4 +73,30 @@ declare namespace appleOcr {
73
73
  ex: number,
74
74
  ey: number
75
75
  ): OCRResult[];
76
+
77
+ /**
78
+ * 执行OCR识别(查找指定文本)
79
+ * @param input 输入源(imageId、URL字符串、文件路径或"screen","screen"表示使用当前屏幕)
80
+ * @param texts 要查找的文本数组
81
+ * @param x 边界框左上角x坐标
82
+ * @param y 边界框左上角y坐标
83
+ * @param ex 边界框右下角x坐标
84
+ * @param ey 边界框右下角y坐标
85
+ * @param languages 识别语言数组,默认为["zh-Hans", "en-US"]
86
+ * @returns 识别结果数组,包含文本、置信度、坐标等信息
87
+ * @example
88
+ * const results = appleOcr.findText("screen", ["123", "456"], 0, 0, 100, 100, ["zh-Hans", "en-US"])
89
+ * results.forEach(result => {
90
+ * logger.info(`文本: ${result.text}, 置信度: ${result.confidence}`)
91
+ * })
92
+ */
93
+ function findText(
94
+ input: string,
95
+ texts: string[],
96
+ x: number,
97
+ y: number,
98
+ ex: number,
99
+ ey: number,
100
+ languages?: string[]
101
+ ): OCRResult[];
76
102
  }
@@ -4,15 +4,15 @@
4
4
  declare namespace paddleOcr {
5
5
  /**
6
6
  * 初始化PP-OCRv5模型
7
- * @param useGpu 是否使用GPU,默认false
7
+ * @param maxSideLen 最大边长,默认2000,可不传
8
8
  * @returns 初始化是否成功
9
9
  * @example
10
- * const loaded = paddleOcr.loadV5(true)
10
+ * const loaded = paddleOcr.loadV5(2000)
11
11
  * if (loaded) {
12
12
  * logger.info("加载成功")
13
13
  * }
14
14
  */
15
- function loadV5(useGpu: boolean): boolean;
15
+ function loadV5(maxSideLen?: number): boolean;
16
16
  /**
17
17
  * 执行OCR识别
18
18
  * @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, false)
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
  /**