Hello,
I am using tfjs-models/face-landmarks-detection at master · tensorflow/tfjs-models · GitHub Tensorflow face landmarks detection library and I am trying to create mesh from tensorflow keypoints.
function create_facemesh_mesh(keypoints){
try {
const geometry = new THREE.BufferGeometry();
geometry.addAttribute( 'position', new THREE.BufferAttribute(new Float32Array(keypoints.flat()),3));
geometry.setIndex( new THREE.BufferAttribute( new Uint16Array(TRIANGULATION), 1 ) );
const material = new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } );
const mesh = new THREE.Mesh( geometry, material );
console.log(mesh);
return mesh;
} catch(n) {
}
}
Please if you have any example how to create, can you share with me? Thank you.