Skip to content

Commit

Permalink
Merge branch 'develop' into develop-hw
Browse files Browse the repository at this point in the history
  • Loading branch information
Tnks2U committed Apr 22, 2024
2 parents 079422c + e0e195b commit e55c710
Show file tree
Hide file tree
Showing 58 changed files with 2,982 additions and 2,483 deletions.
19 changes: 12 additions & 7 deletions extern/face-landmarker.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const contextFlip = (context, axis) => {
}
};

let lastDetect;
const predictFaceLandmarker = async (imageBitmap) => {
try {
if (!workerContext || !human) {
Expand All @@ -177,7 +178,9 @@ const predictFaceLandmarker = async (imageBitmap) => {
if (!isRun || !isFirstIdle) {
return;
}
const results = await human.detect(imageBitmap);
lastDetect = human.detect(imageBitmap);
const results = await lastDetect;

workerContext.save();
workerContext.clearRect(0, 0, 640, 360);

Expand Down Expand Up @@ -225,11 +228,13 @@ const predictFaceLandmarker = async (imageBitmap) => {
}
};

const clearPredictFaceLandmarker = () => {
console.log('clearPredictFaceLandmarker');
const clearPredictFaceLandmarker = async () => {
isRun = false;
self.postMessage({ action: 'run_stop_face_landmarker' });
isPrevFaceLandmarker = false;
countDetectedFace = 0;
workerContext.clearRect(0, 0, 640, 360);
await lastDetect;
requestAnimationFrame(() => {
self.postMessage({ action: 'run_stop_face_landmarker' });
isPrevFaceLandmarker = false;
countDetectedFace = 0;
workerContext.clearRect(0, 0, 640, 360);
});
};
1,077 changes: 648 additions & 429 deletions extern/lang/en.js

Large diffs are not rendered by default.

Loading

0 comments on commit e55c710

Please sign in to comment.