Files
jitsi-meet/react/features/face-landmarks/faceLandmarksWorker.ts
Gabriel Borlea 4b969cf4ab feat(face-landmarks): add face landmarks timeline (#12561)
* feat(face-landmarks): add face landmarks timeline

fixes after rebase

* fixes after rebase compiling and linting

* fix: change keyboard shorcut for participants stats

* fix: label for emotions switch

* fix: linting issues

* code review changes

* fix linting issues

* code review changes 2

* fix typo
2022-11-22 15:56:37 +02:00

27 lines
612 B
TypeScript

import { HumanHelper, IFaceLandmarksHelper } from './FaceLandmarksHelper';
import { DETECT_FACE, INIT_WORKER } from './constants';
let helper: IFaceLandmarksHelper;
onmessage = async function({ data }: MessageEvent<any>) {
switch (data.type) {
case DETECT_FACE: {
if (!helper || helper.getDetectionInProgress()) {
return;
}
const detections = await helper.detect(data);
if (detections) {
self.postMessage(detections);
}
break;
}
case INIT_WORKER: {
helper = new HumanHelper(data);
break;
}
}
};