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

the predictions are an empty array even if my hand is visible in the camera #60

Open
khldon123 opened this issue Sep 13, 2021 · 0 comments

Comments

@khldon123
Copy link

khldon123 commented Sep 13, 2021

this is my code:
`
Navigator.getUserMedia =
Navigator.getUserMedia ||
Navigator.webkitUserMedia ||
Navigator.mozUserMedia ||
Navigator.msUserMedia;
const modelParams = {
flipHorizontal: true, // flip e.g for video
imageScaleFactor: 0.7, // reduce input image size for gains in speed.
maxNumBoxes: 20, // maximum number of boxes to detect
iouThreshold: 0.5, // ioU threshold for non-max suppression
scoreThreshold: 0.79, // confidence threshold for predictions.
};

const video = document.querySelector("#video");
const audio = document.querySelector("#audio");
const canvas = document.querySelector("canvas");
const context = canvas.getContext("2d");
let model;
handTrack.startVidseo(video)
.then((status) => {
if (status) {
navigator.getUserMedia(
{ video: {} },
(stream) => {
video.srcObject = stream;
setInterval(doTheDetection, 1000);
},
(err) => console.log(err)
);
}
});
function doTheDetection() {

model.detect(video)
.then(pred => {
    console.log(pred);
});

}
handTrack.load(modelParams).then((lmodel) => {
model = lmodel;
`});````

this is the result:

handtrackbug

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

1 participant