Open ruellm opened 2 years ago
I had the same problem, specifically 20px seems like a hardcoded placeholder: https://github.com/victordibia/handtrack.js/blob/master/src/index.js#L84
It took me a while to figure this out but it seems like runDetection() of the example is never called, which in turn never resizes the canvas. What solved it for me was fixing the parameter of handTrack.startVideo(video) and resetting the style manually, probably an outdated example.
handTrack.startVideo(video).then(function (**res**) {
console.log("video started", **res**);
if (**res.status**) {
console.log("Video started. Now tracking");
isVideo = true;
runDetection();
} else {
console.error("Please enable video");
}
video.style.height = "";
});
On a related note: Settingstyle="display: none;"
on the video keeps the video running for analysis but hides it from the view. The (rendered) canvas contains both the overlay and the original video stream.
I have a video and a canvas, my video is sized to 640x480, without starting video and prediction the video is displayed properly with its size, but when i call handtrack.startVideo passing the video component, the video becomes small (and a hieght of 20px is inserted).
why is this? here is my code
``
im trying to experiment that only the video is displayed and in exchange I will render something like a circle at the hand's position, but it seems like the video size is greatly coupled with the handtrack object that I cant do it.
whats is wrong?