DEV Community

Discussion on: React + TypeScript: Face detection with Tensorflow

Collapse
 
yuikoito profile image
Yuiko Koyanagi

Yes it works on my environment. (ios)

Collapse
 
vitalii0927 profile image
sapronov1021

Thanks, Yuiko

Thread Thread
 
vitalii0927 profile image
sapronov1021

@yuikoito , do you know how to get screenshot automatically, when doing selfie?

Thread Thread
 
yuikoito profile image
Yuiko Koyanagi

@vitalii0927
sorry for my late reply.
I don't really know how to get screenshot "automatically" but maybe you can use "getScreenshot" method as follows.

  const webcamRef = useRef<Webcam>(null);
  const capture = useCallback(() => {
    const imageSrc = webcamRef.current?.getScreenshot();
    // write anything about imageSrc
  }, [webcamRef]);
Enter fullscreen mode Exit fullscreen mode

Then maybe you can loop this for example in requestAnimationFrame.

Thread Thread
 
vitalii0927 profile image
sapronov1021

Thank you, @yuikoito