Skip to main content

@vonage/ml-transformers

Classes

Enumerations

Interfaces

Functions

getVonageSelfieSegmentation

getVonageSelfieSegmentation(): VonageSelfieSegmentation

MediaPipe Selfie Segmentation static metadata.

Returns

VonageSelfieSegmentation

An object containing MediaPipe Selfie Segmentation metadata:

  • VERSION

getVonageHands

getVonageHands(): VonageHands

Vonage Mediapipe objects info (it will be used by the @mediapipe/drawing_utils package which is not included by this library).

Returns

VonageHands


getVonageHolistic

getVonageHolistic(): VonageHolistic

MediaPipe Holistic static metadata. This metadata is needed while using MediaPipe. drawing utils. And control utils.

Returns

VonageHolistic

An object containing MediaPipe Holistic metadata:

  • VERSION
  • FACE_GEOMETRY
  • FACEMESH_LIPS
  • FACEMESH_LEFT_EYE
  • FACEMESH_LEFT_EYEBROW
  • FACEMESH_LEFT_IRIS
  • FACEMESH_RIGHT_EYE
  • FACEMESH_RIGHT_EYEBROW
  • FACEMESH_RIGHT_IRIS
  • FACEMESH_FACE_OVAL
  • FACEMESH_CONTOURS
  • FACEMESH_TESSELATION
  • HAND_CONNECTIONS
  • POSE_CONNECTIONS
  • POSE_LANDMARKS
  • POSE_LANDMARKS_LEFT
  • POSE_LANDMARKS_RIGHT
  • POSE_LANDMARKS_NEUTRAL

getVonageFaceDetection

getVonageFaceDetection(): VonageFaceDetection

MediaPipe Face Detection static metadata. This metadata is needed while using MediaPipe. drawing utils. And control utils.

Returns

VonageFaceDetection

An object containing MediaPipe Face Detection metadata:

  • VERSION
  • FACEDETECTION_LIPS
  • FACEDETECTION_LEFT_EYE
  • FACEDETECTION_LEFT_EYEBROW
  • FACEDETECTION_RIGHT_EYE
  • FACEDETECTION_RIGHT_EYEBROW
  • FACEDETECTION_FACE_OVAL
  • FACEDETECTION_CONTOURS
  • FACEDETECTION_TESSELATION

getVonageFaceMash

getVonageFaceMash(): VonageFaceMash

MediaPipe Face Mash static metadata. This metadata is needed while using MediaPipe. drawing utils. And control utils.

Returns

VonageFaceMash

An object containing MediaPipe Face Mash metadata:

  • VERSION
  • FACE_GEOMETRY
  • FACEMESH_LIPS
  • FACEMESH_LEFT_EYE
  • FACEMESH_LEFT_EYEBROW
  • FACEMESH_LEFT_IRIS
  • FACEMESH_RIGHT_EYE
  • FACEMESH_RIGHT_EYEBROW
  • FACEMESH_RIGHT_IRIS
  • FACEMESH_FACE_OVAL
  • FACEMESH_CONTOURS
  • FACEMESH_TESSELATION

getVonageObjectron

getVonageObjectron(): VonageObjectron

MediaPipe Objectron static metadata. This metadata is needed while using MediaPipe. drawing utils. And control utils.

Returns

VonageObjectron

An object containing MediaPipe Objectron metadata:

  • VERSION
  • VERSION
  • BOX_CONNECTIONS
  • BOX_KEYPOINTS

getVonagePose

getVonagePose(): VonagePose

MediaPipe Pose static metadata. This metadata is needed while using MediaPipe. drawing utils. And control utils.

Returns

VonagePose

An object containing MediaPipe Pose metadata:

  • VERSION
  • POSE_CONNECTIONS
  • POSE_LANDMARKS
  • POSE_LANDMARKS_LEFT
  • POSE_LANDMARKS_RIGHT
  • POSE_LANDMARKS_NEUTRAL

createVonageMediaProcessor

createVonageMediaProcessor(config): Promise<VonageMediaProcessor>

builder function to create MediaProcessor

Parameters

NameTypeDescription
configBackgroundOptionssee MediaProcessorConfig definition

Returns

Promise<VonageMediaProcessor>

  • MediaProcessor provide interface to configure ml-transformer or retrieving connector

isSupported

isSupported(wasmAssetUriPath?, tfliteAssetUriPath?): Promise<void>

Check if the current browser is officially supported by the library.

Parameters

NameType
wasmAssetUriPath?string
tfliteAssetUriPath?string

Returns

Promise<void>

The promise will resolve or reject depending whether the browser is supported or not.


getSupportedBrowserFeatures

getSupportedBrowserFeatures(wasmAssetUriPath?, tfliteAssetUriPath?): Promise<SupportedBrowserFeatures>

Detect which features is available in the browser.

Parameters

NameType
wasmAssetUriPath?string
tfliteAssetUriPath?string

Returns

Promise<SupportedBrowserFeatures>

Supported features by the browser

Type Aliases

MediaProcessorConfig

Ƭ MediaProcessorConfig: BackgroundOptions

MediaProcessorConfig specifies the transformer logic to be performed.


RenderingOptions

Ƭ RenderingOptions: Canvas2dOptions | WebglOptions


BackgroundOptions

Ƭ BackgroundOptions: BackgroundBlurConfig | VirtualBackgroundConfig | VideoBackgroundConfig | SilhouetteBlurConfig

BackgroundOptions background options


MediaPipeResults

Ƭ MediaPipeResults: FaceDetectionResults | FaceMeshResults | HandsResults | HolisticResults | ObjectronResults | SelfieSegmentationResults | PoseResults

MediaPipeResults types of results object of MediaPipe


MediaPipeResultsListener

Ƭ MediaPipeResultsListener: <T>(results: T) => Promise<void> | void

Type declaration

▸ <T>(results): Promise<void> | void

ResultsListener callback function from MediaPipe process

Results

  • The results object from MediaPipe
Type parameters
NameType
Textends MediaPipeResults
Parameters
NameType
resultsT
Returns

Promise<void> | void

  • can return a promise of void

MediaPipeModelType

Ƭ MediaPipeModelType: "face_mesh" | "face_detection" | "hands" | "holistic" | "objectron" | "selfie_segmentation" | "pose"

MediaPipeModelType supported models types


MediaPipeModelConfig

Ƭ MediaPipeModelConfig: Object

defines one mediapipe model config

Model Type

  • which model is required

Listener

  • callback function from the model

Options

Assets Uri

(optional) - can be set to get wasm/tflite/js/binarypb assets. Vonage provides static assets. WARNING - using this option moves the responsibility of the assets and the versioning to the user. please keep in mind that the assets list can change between versions! assets are different between mediapipe models.

Type declaration

NameType
modelTypeMediaPipeModelType
listenerMediaPipeResultsListener
optionsFaceDetectionOptions | FaceMeshOptions | HandsOptions | HolisticOptions | ObjectronOptions | SelfieSegmentationOptions | PoseOptions
assetsUri?string

MediapipeConfig

Ƭ MediapipeConfig: Object

MediapipeConfig specified config of mediapipe helper: this structure allows the user to create few mediapipe models that will run in parallel.

Model Types Array

  • array of mediapipe models to be loaded and called.

Type declaration

NameType
mediaPipeModelConfigArrayMediaPipeModelConfig[]

EventMetaData

Ƭ EventMetaData: Object

EventMetaData. Some metadata of the event.

Type declaration

NameTypeDescription
transformerIndexnumberThe transformer index in the array of transformers.

DropInfo

Ƭ DropInfo: Object

DropInfo gives info about the frame rate of the transformer

Type declaration

NameTypeDescription
requestednumberThe rate predicted rate of the track
currentnumberThe actual rate of the track

WarnData

Ƭ WarnData: Object

WarnData - MediaProcessor warning event defintion

Type declaration

NameTypeDescription
eventMetaDataEventMetaDataMeta data of the event
warningTypeWarningTypeThe waring type
dropInfo?DropInfoOptional - FPS drop info.

ErrorData

Ƭ ErrorData: Object

ErrorData. MediaProcessor error data definition.

Type declaration

NameTypeDescription
eventMetaDataEventMetaDataMetadata of the event.
functionErrorFunctionThe function in which the error occurred.
errorunknownType of unknown but moslty will be string

EventDataMap

Ƭ EventDataMap: Object

EventDataMap. A map type for all event options from MediaProcessor. Each event will include only one type.

Type declaration

NameTypeDescription
warnWarnDataWarnings from the insertable streams pipeline.
errorErrorDataErrors from the insertable streams pipeline.
pipelineInfoPipelineInfoDataInfo from the insertable streams pipeline life cycle.