Skip to content

Commit

Permalink
refactor(types): sync components types
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKonka authored Sep 18, 2024
1 parent f82561d commit 1100210
Show file tree
Hide file tree
Showing 472 changed files with 10,596 additions and 2,040 deletions.
66 changes: 66 additions & 0 deletions docs/apis/ai/visionkit/VKBodyAnchor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: VKBodyAnchor
sidebar_label: VKBodyAnchor
---

人体 anchor

支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>

> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKBodyAnchor.html)
## 方法

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| id | `number` | 唯一标识 |
| type | `5` | 类型 |
| detectId | `number` | 识别序号 |
| size | `ISize` | 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 |
| origin | `IOrigin` | 相对视窗的位置信息,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 |
| confidence | `number[]` | 关键点的置信度 |
| points | `IPoint[]` | 关键点 |
| score | `number` | 总体置信值 |

## 参数

### IType

类型

| 参数 | 说明 |
| --- | --- |
| 5 | 人体 |

### ISize

相对视窗的尺寸

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| width | `number` | 宽度 |
| height | `number` | 高度 |

### IOrigin

相对视窗的位置信息

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| x | `number` | 横坐标 |
| y | `number` | 纵坐标 |

### IPoint

关键点

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| x | `number` | 横坐标 |
| y | `number` | 纵坐标 |

## API 支持度

| API | 微信小程序 | H5 | React Native | Harmony |
| :---: | :---: | :---: | :---: | :---: |
| VKBodyAnchor | ✔️ | | | |
44 changes: 44 additions & 0 deletions docs/apis/ai/visionkit/VKDepthAnchor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: VKDepthAnchor
sidebar_label: VKDepthAnchor
---

depth anchor

支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>

> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKDepthAnchor.html)
## 方法

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| id | `number` | 唯一标识 |
| type | `8` | 类型 |
| size | `ISize` | 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 |
| depthArray | `number[]` | 包含深度信息的数组 |

## 参数

### IType

类型

| 参数 | 说明 |
| --- | --- |
| 8 | DEPTH |

### ISize

相对视窗的尺寸

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| width | `number` | 宽度 |
| height | `number` | 高度 |

## API 支持度

| API | 微信小程序 | H5 | React Native | Harmony |
| :---: | :---: | :---: | :---: | :---: |
| VKDepthAnchor | ✔️ | | | |
66 changes: 66 additions & 0 deletions docs/apis/ai/visionkit/VKFaceAnchor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: VKFaceAnchor
sidebar_label: VKFaceAnchor
---

人脸 anchor

支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>

> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFaceAnchor.html)
## 方法

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| id | `number` | 唯一标识 |
| type | `3` | 类型 |
| detectId | `number` | 识别序号 |
| origin | `IOrigin` | 相对视窗的位置信息,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 |
| size | `ISize` | 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 |
| points | `IPoint[]` | 人脸 106 个关键点的坐标 |
| angle | `number[]` | 人脸角度信息 |
| confidence | `number` | 关键点的置信度 |

## 参数

### IType

类型

| 参数 | 说明 |
| --- | --- |
| 3 | 人脸 |

### ISize

相对视窗的尺寸

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| width | `number` | 宽度 |
| height | `number` | 高度 |

### IOrigin

相对视窗的位置信息

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| x | `number` | 横坐标 |
| y | `number` | 纵坐标 |

### IPoint

关键点

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| x | `number` | 横坐标 |
| y | `number` | 纵坐标 |

## API 支持度

| API | 微信小程序 | H5 | React Native | Harmony |
| :---: | :---: | :---: | :---: | :---: |
| VKFaceAnchor | ✔️ | | | |
24 changes: 22 additions & 2 deletions docs/apis/ai/visionkit/VKFrame.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,32 @@ vision kit 会话对象
> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getCameraTexture.html)
```tsx
(ctx: WebGLRenderingContext) => getCameraTextureResult
(ctx: WebGLRenderingContext) => IGetCameraTextureResult
```

| 参数 | 类型 |
| --- | --- |
| ctx | `WebGLRenderingContext` |

### getCameraBuffer

获取当前帧 rgba buffer。iOS 端微信在 v8.0.20 开始支持,安卓端微信在 v8.0.30 开始支持。
按 aspect-fill 规则裁剪,此接口要求在创建 VKSession 对象时必须传入 gl 参数。
此接口仅建议拿来做帧分析使用,上屏请使用 getCameraTexture 来代替。

支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>

> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getCameraBuffer.html)
```tsx
(widht: number, height: number) => ArrayBuffer
```

| 参数 | 类型 |
| --- | --- |
| widht | `number` |
| height | `number` |

### getDisplayTransform

获取纹理调整矩阵。默认获取到的纹理是未经裁剪调整的纹理,此矩阵可用于在着色器中根据帧对象尺寸对纹理进行裁剪
Expand All @@ -46,7 +65,7 @@ vision kit 会话对象

## 参数

### getCameraTextureResult
### IGetCameraTextureResult

帧纹理对象

Expand All @@ -61,4 +80,5 @@ vision kit 会话对象
| :---: | :---: | :---: | :---: | :---: |
| VKFrame | ✔️ | | | |
| VKFrame.getCameraTexture | ✔️ | | | |
| VKFrame.getCameraBuffer | ✔️ | | | |
| VKFrame.getDisplayTransform | ✔️ | | | |
93 changes: 93 additions & 0 deletions docs/apis/ai/visionkit/VKHandAnchor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
title: VKHandAnchor
sidebar_label: VKHandAnchor
---

手势 anchor

支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>

> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKHandAnchor.html)
## 方法

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| id | `number` | 唯一标识 |
| type | `7` | 类型 |
| detectId | `number` | 识别序号 |
| size | `ISize` | 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 |
| origin | `IOrigin` | 相对视窗的位置信息,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 |
| confidence | `number[]` | 关键点的置信度 |
| points | `IPoint[]` | 关键点 |
| score | `number` | 总体置信值 |
| gesture | keyof IGesture or -1 | 手势分类, 返回整数 -1 到 18, -1 表示无效手势 |

## 参数

### IType

类型

| 参数 | 说明 |
| --- | --- |
| 7 | 手势 |

### ISize

相对视窗的尺寸

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| width | `number` | 宽度 |
| height | `number` | 高度 |

### IOrigin

相对视窗的位置信息

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| x | `number` | 横坐标 |
| y | `number` | 纵坐标 |

### IPoint

关键点

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| x | `number` | 横坐标 |
| y | `number` | 纵坐标 |

### IGesture

手势分类

| 参数 | 说明 |
| --- | --- |
| 0 | 单手比心 |
| 1 | 布(数字5) |
| 2 | 剪刀(数字2) |
| 3 | 握拳 |
| 4 | 数字1 |
| 5 | 热爱 |
| 6 | 点赞 |
| 7 | 数字3 |
| 8 | 摇滚 |
| 9 | 数字6 |
| 10 | 数字8 |
| 11 | 双手抱拳(恭喜发财) |
| 12 | 数字4 |
| 13 | 比ok |
| 14 | 不喜欢(踩) |
| 15 | 双手比心 |
| 16 | 祈祷(双手合十) |
| 17 | 双手抱拳 |
| 18 | 无手势动作 |

## API 支持度

| API | 微信小程序 | H5 | React Native | Harmony |
| :---: | :---: | :---: | :---: | :---: |
| VKHandAnchor | ✔️ | | | |
36 changes: 36 additions & 0 deletions docs/apis/ai/visionkit/VKMarkerAnchor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: VKMarkerAnchor
sidebar_label: VKMarkerAnchor
---

marker anchor

支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>

> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKMarkerAnchor.html)
## 方法

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| id | `number` | 唯一标识 |
| type | `1` | 类型 |
| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 |
| markerId | `number` | marker id |
| path | `string` | 图片路径 |

## 参数

### IType

类型

| 参数 | 说明 |
| --- | --- |
| 1 | marker |

## API 支持度

| API | 微信小程序 | H5 | React Native | Harmony |
| :---: | :---: | :---: | :---: | :---: |
| VKMarkerAnchor | ✔️ | | | |
34 changes: 34 additions & 0 deletions docs/apis/ai/visionkit/VKOCRAnchor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: VKOCRAnchor
sidebar_label: VKOCRAnchor
---

OCR anchor

支持情况:<img title="微信小程序" src={require('@site/static/img/platform/weapp.png').default} className="icon_platform" width="25px"/> <img title="H5" src={require('@site/static/img/platform/h5.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="React Native" src={require('@site/static/img/platform/rn.png').default} className="icon_platform icon_platform--not-support" width="25px"/> <img title="Harmony" src={require('@site/static/img/platform/harmony.png').default} className="icon_platform icon_platform--not-support" width="25px"/>

> [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKOCRAnchor.html)
## 方法

| 参数 | 类型 | 说明 |
| --- | --- | --- |
| id | `number` | 唯一标识 |
| type | `6` | 类型 |
| text | `string` | 识别的文字结果 |

## 参数

### IType

类型

| 参数 | 说明 |
| --- | --- |
| 6 | OCR |

## API 支持度

| API | 微信小程序 | H5 | React Native | Harmony |
| :---: | :---: | :---: | :---: | :---: |
| VKOCRAnchor | ✔️ | | | |
Loading

0 comments on commit 1100210

Please sign in to comment.