three-mediapipe-rig 0.0.4 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,8 +9,10 @@ The motion from the webcam will be applied to a skeleton. Angle based so it work
9
9
 
10
10
  This will run 3 models: face, body, hands. So expect a FPS drop.
11
11
 
12
- LIVE EXAMPLE: https://bandinopla.github.io/three-mediapipe-rig/
13
-
12
+ Expolore the demos:
13
+ - [Characters](https://bandinopla.github.io/three-mediapipe-rig)
14
+ - [Hands Demo](https://bandinopla.github.io/three-mediapipe-rig/?demo=hands)
15
+ - [**Video to Face Geometry** !!](https://bandinopla.github.io/three-mediapipe-rig/?demo=face-uv)
14
16
  ---
15
17
 
16
18
  ## Table of Contents
@@ -26,6 +28,7 @@ LIVE EXAMPLE: https://bandinopla.github.io/three-mediapipe-rig/
26
28
  - [Bone Naming](#bone-naming)
27
29
  - [Default bone names](#default-bone-names)
28
30
  - [Custom bone map example](#custom-bone-map-example)
31
+ - [Video -> Facial Geometry](#video-to-facial-geometry)
29
32
  - [Multiple Characters](#multiple-characters)
30
33
  - [Debugging with Video](#debugging-with-video)
31
34
  - [Recording](#recording)
@@ -221,11 +224,21 @@ const myBoneMap: BoneMap = {
221
224
  index3L: "LeftHandIndex3",
222
225
  // (continue for all fingers)
223
226
  };
224
-
225
- const binding = tracker.bind(rig, myBoneMap);
226
227
  ```
228
+
227
229
 
228
- ---
230
+ ## Video to Facial Geometry
231
+ Media Pipe's facial tracking also provides a facial mesh, if you [download the face mesh object](https://github.com/google-ai-edge/mediapipe/tree/master/mediapipe/modules/face_geometry) you can also make it deform and be textured using the webcam data. This will texture the mesh with the feed from the camera and also will move the vertices to adjust to the facial expressions:
232
+
233
+ ```js
234
+ const face = tracker.faceTracker.bindGeometry( faceMesh );
235
+
236
+ //... and in your loop
237
+ face.update(delta)
238
+ ```
239
+
240
+ ### How does this work?
241
+ You use the canonical face model provided by media pipe ( this is important because it has the same number of vertices as the facial mesh ), this code will create a positionNode ( needs a NodeMaterial ) that will adjust the position of the vertices to match the facial mesh and also it will use the video feed as a texture for the mesh, so it will look like the face is deforming and moving with the webcam feed.
229
242
 
230
243
  ## Multiple Characters
231
244