Skip to main content

Class: HumansOptions

Defined in: src/world/humans/HumansOptions.ts:7

Configuration options for the Human Pose Detection system.

Constructors​

Constructor​

new HumansOptions(options?): HumansOptions

Defined in: src/world/humans/HumansOptions.ts:67

Parameters​

options?​
backendConfig?​

{ activeBackend?: string; mediapipe?: { minPoseDetectionConfidence?: number; minPosePresenceConfidence?: number; minTrackingConfidence?: number; modelAssetPath?: string; numPoses?: number; useWorker?: boolean; wasmFilesUrl?: string; }; } = ...

Configuration options for the active pose detection backend.

backendConfig.activeBackend?​

string = 'mediapipe'

backendConfig.mediapipe?​

{ minPoseDetectionConfidence?: number; minPosePresenceConfidence?: number; minTrackingConfidence?: number; modelAssetPath?: string; numPoses?: number; useWorker?: boolean; wasmFilesUrl?: string; } = ...

backendConfig.mediapipe.minPoseDetectionConfidence?​

number = 0.5

The minimum confidence score [0.0, 1.0] required for a pose to be detected.

backendConfig.mediapipe.minPosePresenceConfidence?​

number = 0.5

The minimum confidence score [0.0, 1.0] required to confirm a pose is still present.

backendConfig.mediapipe.minTrackingConfidence?​

number = 0.5

The minimum confidence score [0.0, 1.0] required for tracking landmarks between frames.

backendConfig.mediapipe.modelAssetPath?​

string = 'https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_full/float16/latest/pose_landmarker_full.task'

backendConfig.mediapipe.numPoses?​

number = 1

The maximum number of simultaneous human poses/bodies to track.

backendConfig.mediapipe.useWorker?​

boolean = true

Run inference in a web worker so a detection pass does not stall the render loop. The worker is limited to the CPU delegate because MediaPipe only creates a GPU surface for a real DOM canvas, so set this to false to trade a blocked main thread for GPU inference. Falls back to the main thread automatically when workers are unavailable.

backendConfig.mediapipe.wasmFilesUrl?​

string = 'https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm'

enable?​

() => HumansOptions

enabled?​

boolean = false

pollingIntervalMs?​

number = 0

Minimum delay in milliseconds between continuous pose detection runs. A value of 0 runs again as soon as the previous detection finishes.

useDepthProjection?​

boolean = true

Project each landmark onto the depth mesh to find its world position.

This is what you want when the people being detected are physically in front of you, since the ray lands on their actual body. Turn it off when the camera is showing someone who is not part of the depth scene, such as a webcam feed on the desktop simulator: every ray would then hit the surrounding geometry instead and the skeleton would be smeared across it. With projection off, landmarks are placed along the view ray at a fixed distance, which keeps the body correctly proportioned.

Returns​

HumansOptions

Properties​

backendConfig​

backendConfig: object

Defined in: src/world/humans/HumansOptions.ts:32

Configuration options for the active pose detection backend.

activeBackend​

activeBackend: string = 'mediapipe'

mediapipe​

mediapipe: object

mediapipe.minPoseDetectionConfidence​

minPoseDetectionConfidence: number = 0.5

The minimum confidence score [0.0, 1.0] required for a pose to be detected.

mediapipe.minPosePresenceConfidence​

minPosePresenceConfidence: number = 0.5

The minimum confidence score [0.0, 1.0] required to confirm a pose is still present.

mediapipe.minTrackingConfidence​

minTrackingConfidence: number = 0.5

The minimum confidence score [0.0, 1.0] required for tracking landmarks between frames.

mediapipe.modelAssetPath​

modelAssetPath: string = 'https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_full/float16/latest/pose_landmarker_full.task'

mediapipe.numPoses​

numPoses: number = 1

The maximum number of simultaneous human poses/bodies to track.

mediapipe.useWorker​

useWorker: boolean = true

Run inference in a web worker so a detection pass does not stall the render loop. The worker is limited to the CPU delegate because MediaPipe only creates a GPU surface for a real DOM canvas, so set this to false to trade a blocked main thread for GPU inference. Falls back to the main thread automatically when workers are unavailable.

mediapipe.wasmFilesUrl​

wasmFilesUrl: string = 'https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm'


enabled​

enabled: boolean = false

Defined in: src/world/humans/HumansOptions.ts:8


pollingIntervalMs​

pollingIntervalMs: number = 0

Defined in: src/world/humans/HumansOptions.ts:14

Minimum delay in milliseconds between continuous pose detection runs. A value of 0 runs again as soon as the previous detection finishes.


useDepthProjection​

useDepthProjection: boolean = true

Defined in: src/world/humans/HumansOptions.ts:27

Project each landmark onto the depth mesh to find its world position.

This is what you want when the people being detected are physically in front of you, since the ray lands on their actual body. Turn it off when the camera is showing someone who is not part of the depth scene, such as a webcam feed on the desktop simulator: every ray would then hit the surrounding geometry instead and the skeleton would be smeared across it. With projection off, landmarks are placed along the view ray at a fixed distance, which keeps the body correctly proportioned.

Methods​

enable()​

enable(): HumansOptions

Defined in: src/world/humans/HumansOptions.ts:73

Returns​

HumansOptions