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

FaceControls simplified #2242

Merged
merged 2 commits into from
Dec 5, 2024
Merged

FaceControls simplified #2242

merged 2 commits into from
Dec 5, 2024

Conversation

abernier
Copy link
Member

@abernier abernier commented Dec 1, 2024

Why / What

Optionally, we can now pass faceLandmarkerResult from the outside, allowing us to fully control the face detection from the video-texture:

// faceLandmarker

const videoTextureRef = useRef(null)
const [faceLandmarkerResult, setFaceLandmarkerResult] = useState()

<WebcamVideoTexture
  ref={videoTextureRef}
  onVideoFrame={(now) => {
    const videoTexture = videoTextureRef.current
    if (!faceLandmarker || !videoTexture) return

    const videoFrame = videoTexture.source.data
    const result = faceLandmarker.detectForVideo(videoFrame, now) // DETECTION HERE
    setFaceLandmarkerResult(result)
  }}
/>

<FaceControls manualDetect faceLandmarkerResult={faceLandmarkerResult} />

otherwise, a video-texture is automatically instanciated for us, like before

Checklist

  • Documentation updated (example)
  • Storybook entry added (example)
  • Ready to be merged

Copy link

vercel bot commented Dec 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 3:36pm

Copy link

codesandbox-ci bot commented Dec 1, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@abernier abernier force-pushed the facecontrols-simplified branch from 495fe28 to 8d6748a Compare December 5, 2024 15:35
@abernier abernier merged commit 75260b8 into master Dec 5, 2024
5 checks passed
@abernier abernier deleted the facecontrols-simplified branch December 5, 2024 15:43
Copy link

github-actions bot commented Dec 5, 2024

🎉 This PR is included in version 9.120.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant