
XYZ stored in RGB, 13 per row, 36 rows, 468 total.These are the unmodified outputs of the 3D Facemesh points.13 XYZ points per row, 36 rows, 468 points total.Open the prebuilt scene or drop in a prefab.
Without a good SVD method, it's harder to undo rotations and translations for the eyes accurately.
Iris tracking also requires the eyes to be in the very center. Slow implementation, it's only fast cause it's made for mobile devices.
The only one I found was UnitySVDComputeShader and it only solves 3x3 matrices, meaning I can only use 3 points from Facemesh to solve the rotation.
SVD (singular value decomposition) not accurate, there isn't any SVD libraries written for HLSL. No face detection, meaning the user must have their face within the center of the input camera. Right eye inputs must be flipped horizontally during input and flipped back at output.Īt the final step, a shader takes Facemesh and Iris model outputs, calculates blendshape values based on key points and smooths the results. The Iris model has two outputs, same as the original, 71 3D brows and contour points and 5 3D iris points. The eye positions are also used to feed into the Iris tracking model. To retrieve the head rotations, I use SVD (singular value decomposition) on three points outputted from Facemesh to get the rotation matrix. My implementation of Facemesh throws out the 133 2D contour outputs to save computation time since I won't be using those. The original Facemesh model has three main outputs: face flag, 468 3D face points, and 133 2D contour points (edge points of face, eyes, mouth). Both networks are capped at 60 FPS in this implementation but can be modified to run faster. Table of Contentsįace landmark detection using two MediaPipe models: Facemesh and Iris, implemented inside Unity using over 120 Custom Render Textures.ĭesigned for mobile platforms, the two networks are perfect for use in VR. NOTE: This was built and tested with Unity 2019.4.29f1 using built-in render pipeline, there may be shader compatibility issues with other versions.