Class

HumanVideoSentimentAnalyzer

HumanSentimentAnalyser.HumanVideoSentimentAnalyzer()

Human.js-based Video Sentiment Analyzer Drop-in replacement for VideoSentimentAnalyzer with 5-10x better performance. Automatically uses WebGPU when available for additional 2-3x speedup.

Constructor

# new HumanVideoSentimentAnalyzer()

Methods

# async analyzeVideo(videoElement, videoId) → {Promise.<void>}

Analyze video for emotions and engagement

Parameters:
Name Type Description
videoElement HTMLVideoElement

Video element to analyze

videoId string

Unique identifier for this video

Promise.<void>

# async canDetectFaces(videoElementopt) → {Object}

Check if detection is possible

Parameters:
Name Type Attributes Default Description
videoElement HTMLVideoElement <optional>
null

Detection capability

Object

# destroy()

Clean up resources

# getBackendInfo() → {Object|null}

Get the currently selected backend

Object | null

# getModelInfo() → {Object}

Get detailed information about loaded models and configuration

Detailed model and environment info

Object

# getPerformanceStats() → {Object}

Get performance stats

Object

# async initialize() → {Promise.<void>}

Initialize Human.js with automatic backend detection

Promise.<void>

# setDebugMode(enabled)

Enable/disable debug mode

Parameters:
Name Type Description
enabled boolean

# stopAnalysis()

Stop analysis

# async static detectOptimalBackend() → {Promise.<{backend: string, reason: string}>}

Detect the optimal backend for the current environment Priority: webgpu > webgl > wasm > cpu

Promise.<{backend: string, reason: string}>

# async static isWebGPUAvailable() → {Promise.<boolean>}

Check if WebGPU is available in the current environment

Promise.<boolean>