Open ngochai27595 opened 3 years ago
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); })
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](https://user-images.githubusercontent.com/58677968/116834736-a346fc00-abe9-11eb-980f-dc1470289807.png)