init mediapipe & tensorflow

This commit is contained in:
mphstar 2025-02-22 18:55:42 +07:00
parent 8e8d317da3
commit dc7e39f6d3
1 changed files with 5 additions and 5 deletions

View File

@ -58,11 +58,13 @@ const Home = () => {
if (videoRef.current) { if (videoRef.current) {
videoRef.current.srcObject = stream; videoRef.current.srcObject = stream;
mediapipeHelper = new MediapipeHelper(videoRef);
detectionHelper = new DetectionHelper();
console.log("Camera access granted and helpers initialized."); console.log("Camera access granted and helpers initialized.");
} }
mediapipeHelper = new MediapipeHelper(videoRef);
detectionHelper = new DetectionHelper();
setLoadCamera(true); setLoadCamera(true);
onHandDetected(); onHandDetected();
} catch (error) { } catch (error) {
@ -79,9 +81,7 @@ const Home = () => {
startWebcam(); startWebcam();
return () => { return () => {};
};
}, []); }, []);
return ( return (