8.7 发布—WinterCG 合规性第一部分
了解更多

在 GitHub 上查看

@nativescript/mlkit-pose-detection

一个与 @nativescript/mlkit-core 结合使用的插件,用于启用姿势检测并提供 PoseResult 类型用于姿势检测事件数据。

内容

安装

通过运行以下命令安装 @nativescript/mlkit-pose-detection

命令行界面
npm install @nativescript/mlkit-pose-detection

使用 @nativescript/mlkit-pose-detection

有关示例,请阅读 使用 @nativescript/mlkit-core姿势检测

API

PoseResult

姿势检测事件数据类型。

ts
interface PoseResult {
  landmarks: [PoseLandMark]
}

PoseLandMark

ts
interface PoseLandMark {
  inFrameLikelihood: number
  position: PoseLandMarkPosition
  type?: PoseType
}

PoseLandMarkPosition

ts
interface PoseLandMarkPosition {
  x: number
  y: number
  z: number
}

PoseType

ts
enum PoseType {
  LeftAnkle = 'leftAnkle',
  LeftEar = 'leftEar',
  LeftElbow = 'leftElbow',
  LeftEye = 'leftEye',
  LeftEyeInner = 'leftEyeInner',
  LeftEyeOuter = 'leftEyeOuter',
  LeftHeel = 'leftHeel',
  LeftHip = 'leftHip',
  LeftIndexFinger = 'leftIndex',
  LeftKnee = 'leftKnee',
  LeftPinkyFinger = 'leftPinky',
  LeftShoulder = 'leftShoulder',
  LeftThumb = 'leftThumb',
  LeftToe = 'leftToe',
  LeftWrist = 'leftWrist',
  MouthLeft = 'mouthLeft',
  MouthRight = 'mouthRight',
  Nose = 'nose',
  RightAnkle = 'rightAnkle',
  RightEar = 'rightEar',
  RightElbow = 'rightElbow',
  RightEye = 'rightEye',
  RightEyeInner = 'rightEyeInner',
  RightEyeOuter = 'rightEyeOuter',
  RightHeel = 'rightHeel',
  RightHip = 'rightHip',
  RightIndexFinger = 'rightIndex',
  RightKnee = 'rightKnee',
  RightPinkyFinger = 'rightPinky',
  RightShoulder = 'rightShoulder',
  RightThumb = 'rightThumb',
  RightToe = 'rightToe',
  RightWrist = 'rightWrist',
  Unknown = 'unknown',
}

许可证

Apache 许可证 2.0 版