handtrack.js
handtrack.js copied to clipboard
How would I disable Face Tracking?
Is there a way I can disable face tracking? All I want is open, closed, pinch, point, point tip, and pinch tip.
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);
Thanks!
How can i do this implementation?