Skip to content

Commit

Permalink
Leave comment to know fps
Browse files Browse the repository at this point in the history
  • Loading branch information
nacmartin committed Mar 27, 2023
1 parent a39cab5 commit 6ef4fbd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/manitas/src/gestures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ function runContinously(
present: false,
},
};
function go() {
//let LAST_FRAME_TIME = 0;
function go(TIME: number) {
//let fps = 1 / ((performance.now() - LAST_FRAME_TIME) / 1000);
//console.log(fps);

//LAST_FRAME_TIME = TIME;
let nowInMs = Date.now();
const results = gestureRecognizer.recognizeForVideo(video, nowInMs);

Expand All @@ -91,6 +96,7 @@ function runContinously(
let leftHand: HandState = { present: false };
handednesses.forEach((hand, idx) => {
const category: vision.Category = hand[0];

if (category.score > config.handednessThreshold) {
// Ugly: we flip hands because we need to flip video
if (category.categoryName === "Left") {
Expand Down Expand Up @@ -119,7 +125,7 @@ function runContinously(

window.requestAnimationFrame(go);
}
go();
go(0);
}

function compareStatesAndEmitEvents(
Expand Down

0 comments on commit 6ef4fbd

Please sign in to comment.