this is my current code
const input = document.getElementById("input");
var handOpen = false;
var handXPos = window.innerWidth / 2;
function onHandResults(results) {
if (results.multiHandLandmarks) {
for (const landmarks of results.multiHandLandmarks) {
const wrist = landmarks[0];
const thumbTip = landmarks[4];
const indexFingerTip = landmarks[8];
if (thumbTip.y < indexFingerTip.y) {
handOpen = true;
} else {
handOpen = false;
}
handXPos = wrist.x * window.innerWidth;
console.log(handOpen)
}
}
}
const hands = new Hands({
locateFile: (file) => {
console.log(file)
return `https://cdn.jsdelivr.net/npm/@mediapipe/hands/${file}`;
}
});
hands.setOptions({
maxNumHands: 1,
minDetectionConfidence: 0.5,
minTrackingConfidence: 0.3,
});
hands.onResults(onHandResults);
const camera = new Camera(input, {
onFrame: async () => {
await hands.send({image: input});
},
width: window.innerWidth,
height: window.innerHeight,
});
camera.start();
but it keeps returning the following error
RuntimeError: Aborted(native code called abort())