Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How would I disable Face Tracking? #63

Open
AyaanZaveri opened this issue Oct 23, 2021 · 3 comments
Open

How would I disable Face Tracking? #63

AyaanZaveri opened this issue Oct 23, 2021 · 3 comments

Comments

@AyaanZaveri
Copy link

Is there a way I can disable face tracking? All I want is open, closed, pinch, point, point tip, and pinch tip.

@vladmandic
Copy link

see my implementation at: https://github.com/vladmandic/human/blob/863850054218cb55598faa08d43a6c1ecb3e96a7/src/hand/handtrack.ts#L97

key part is

[t.rawScores, t.rawBoxes] = await models[0].executeAsync(t.cast, modelOutputNodes) as Tensor[];
  t.boxes = tf.squeeze(t.rawBoxes, [0, 2]);
  t.scores = tf.squeeze(t.rawScores, [0]);
  const classScores: Array<Tensor> = tf.unstack(t.scores, 1); // unstack scores based on classes
  tf.dispose(classScores[faceIndex]);
  classScores.splice(faceIndex, 1); // remove faces
  t.filtered = tf.stack(classScores, 1); // restack
  tf.dispose(classScores);
  t.max = tf.max(t.filtered, 1); // max overall score
  t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes, t.max, config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence);

@AyaanZaveri
Copy link
Author

Thanks!

@ahmetturk93
Copy link

How can i do this implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants