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

Cannot detect for live camera? #52

Open
ngochai27595 opened this issue May 3, 2021 · 0 comments
Open

Cannot detect for live camera? #52

ngochai27595 opened this issue May 3, 2021 · 0 comments

Comments

@ngochai27595
Copy link

Hi author,
I'm trying to detect hand of two cameras in my conference like below image. But the result always return null. Could you help me? Thanks
Here is my code:
const largeVideo = ((document.getElementById('largeVideo'): any): HTMLVideoElement);
const localVideo = ((document.getElementById('localVideo_container'): any): HTMLVideoElement);
// Load the model.
const defaultParams = {
flipHorizontal: false,
modelType: "ssd640fpnlite",
modelSize: "medium",
};
handTrack.load(defaultParams).then(model => {
console.log("model loaded");
setTimeout(() => { clearInterval(checkHighFive); }, 6000);
checkHighFive = setInterval(()=>{
let localHand = false;
model.detect(localVideo).then(predictions => {
console.log('Predictions localVideo: ', predictions);
if(predictions.lenght > 0 && predictions[0].label == "open"){
localHand = true;
}
});
model.detect(remoteVideo).then(predictions => {
console.log('Predictions remoteVideo: ', predictions);
if(predictions.lenght > 0 && predictions[0].label == "open" && localHand){
this.props.dispatch(highFive(true));
setTimeout(() => { this.props.dispatch(highFive(false)); }, 4000);
this.props.conference.sendCommandOnce('HIGH_FIVE', { value:_participant.id });
clearInterval(checkHighFive);
}
});
}, 500);
})
image

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