Appery Pose Detection
Pose detection
Present camera view with pose detection overlay
PoseDetector.detectPoseFromCamera
PoseDetector.detectPoseFromCamera
Opens the camera view with an overlay displaying detected pose landmarks. Returns the list of detected poses (for all captured frames).
Parameters
- {function}
success
- callback function which takes a parameter data which will be invoked on success - {function}
error
- callback function which takes a parameter err which will be invoked on failure
Supported Options
property | value | description |
---|---|---|
detectionMode | STREAM_MODE (default) / SINGLE_IMAGE_MODE | In STREAM_MODE (default), the object detector runs with low latency, but might produce incomplete results (such as unspecified bounding boxes or category labels) on the first few invocations of the detector. Also, in STREAM_MODE, the detector assigns tracking IDs to objects, which you can use to track objects across frames. Use this mode when you want to track objects, or when low latency is important, such as when processing video streams in real time. |
showDetectedPose | false / true (default) | Whether or not show silhouette of detected pose |
Example
ApperyioMLCordovaPlugin.PoseDetector.detectPoseFromCamera(
results => console.log(results),
error => console.log(error),
{
detectionMode: ApperyioMLCordovaPlugin.PoseDetector.PoseDetectorOptions.DetectionMode.STREAM,
showDetectedPose: true
}
);
Sample JSON callback: pose_detection.json
Present camera view with real time pose detection overlay
PoseDetector.startRealTimeDetection
PoseDetector.startRealTimeDetection
Opens the camera view with an overlay displaying detected pose landmarks. Returns steam of detected poses.
Parameters
- {function}
success
- callback function which takes a parameter data which will be invoked on success - {function}
error
- callback function which takes a parameter err which will be invoked on failure
Supported Options
property | value | description |
---|---|---|
detectionMode | STREAM_MODE (default) / SINGLE_IMAGE_MODE | In STREAM_MODE (default), the object detector runs with low latency, but might produce incomplete results (such as unspecified bounding boxes or category labels) on the first few invocations of the detector. Also, in STREAM_MODE, the detector assigns tracking IDs to objects, which you can use to track objects across frames. Use this mode when you want to track objects, or when low latency is important, such as when processing video streams in real time. |
showDetectedPose | false / true (default) | Whether or not show silhouette of detected pose |
frameImageData | true (default) / false | Whether include base64 of captured photo or not |
frameImageResultType | CameraResultType.BASE64_STRING (default) / CameraResultType.DATA_URL | include captured photo as only base64 string or as full data url |
delay | 500 (default) | Time interval in msec, for performing detection each interval value |
encodingType | EncodingType.JPEG (default) / EncodingType.PNG | format of output photo base64 |
cameraDirection | CameraDirection.BACK (default) / CameraDirection.FRONT | Use back or front camera of device during pose detection |
Example
ApperyioMLCordovaPlugin.PoseDetector.startRealTimeDetection(
results => console.log(results),
error => console.log(error),
{
detectionMode: ApperyioMLCordovaPlugin.PoseDetectorOptions.DetectionMode.STREAM,
showDetectedPose: true,
frameImageData: true,
frameImageResultType: CameraResultType.DATA_URL,
delay: 200,
encodingType: ApperyioMLCordovaPlugin.PoseDetectorOptions.EncodingType.PNG,
cameraDirection: ApperyioMLCordovaPlugin.PoseDetectorOptions.CameraDirection.BACK
}
);
Sample JSON callback: pose_detection_realtime.json
Detect pose on a single image
PoseDetector.detectPose
PoseDetector.detectPose
Detects pose in a single image.
Parameters
- {string}
imageUrlOrContent
- path to an image or base64 encoded image data (depending onuseBase64
option) - {function}
success
- callback function which takes a parameter data which will be invoked on success - {function}
error
- callback function which takes a parameter err which will be invoked on failure
Supported Options
property | value | description |
---|---|---|
useBase64 | false (default) / true | Whether or not imageUrlOrContent is a base64 encoded string. |
detectionMode | STREAM_MODE (default) / SINGLE_IMAGE_MODE | In STREAM_MODE (default), the object detector runs with low latency, but might produce incomplete results (such as unspecified bounding boxes or category labels) on the first few invocations of the detector. Also, in STREAM_MODE, the detector assigns tracking IDs to objects, which you can use to track objects across frames. Use this mode when you want to track objects, or when low latency is important, such as when processing video streams in real time. |
Example
let path = cordova.file.applicationDirectory + "image.jpg";
ApperyioMLCordovaPlugin.PoseDetector.detectPose(
path,
results => console.log(results),
error => console.log(error),
{
useBase64: false,
detectionMode: ApperyioMLCordovaPlugin.PoseDetector.PoseDetectorOptions.DetectionMode.STREAM
}
);
Sample JSON callback: pose_detection.json
Updated about 2 months ago