System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS Sonoma 14.4
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: n/a
- TensorFlow.js installed from (npm or script link): n/a
- TensorFlow.js version (use command below): n/a
- Browser version: Firefox Developer Edition 125.0b3 (64-bit)
- Tensorflow.js Converter Version: n/a
Describe the current behavior
keypoint 291 (a corner of the lips, see mesh_map) is not present in MEDIAPIPE_FACE_MESH_KEYPOINTS_BY_CONTOUR.lips
Describe the expected behavior
keypoint 291 should be included in MEDIAPIPE_FACE_MESH_KEYPOINTS_BY_CONTOUR.lips
Standalone code to reproduce the issue
Lips corner not rendered correctly in face-landmarks-detection MediaPipe demo
Other info / logs
I suspect the issue comes from constants.ts. See snippets below:
lips: connectionsToIndices(LIPS_CONNECTIONS),
function connectionsToIndices(connections: PairArray) {
const indices = connections.map(connection => connection[0]);
indices.push(connections[connections.length - 1][1]);
return indices;
}
const LIPS_CONNECTIONS: PairArray = [
[61, 146], [146, 91], [91, 181], [181, 84], [84, 17], [17, 314],
[314, 405], [405, 321], [321, 375], [375, 291], [61, 185], [185, 40],
[40, 39], [39, 37], [37, 0], [0, 267], [267, 269], [269, 270],
[270, 409], [409, 291], [78, 95], [95, 88], [88, 178], [178, 87],
[87, 14], [14, 317], [317, 402], [402, 318], [318, 324], [324, 308],
[78, 191], [191, 80], [80, 81], [81, 82], [82, 13], [13, 312],
[312, 311], [311, 310], [310, 415], [415, 308],
];
In particular, connections.map(connection => connection[0]); eliminates keypoint 291 from the indices.
This happens because 291 appears as the second element in both [375, 291] and [409, 291] whereas 61 (the other corner of the lips) appears as the first element in both [61, 146] and [61, 185].
Hope this helps!
System information
Describe the current behavior
keypoint291(a corner of the lips, see mesh_map) is not present inMEDIAPIPE_FACE_MESH_KEYPOINTS_BY_CONTOUR.lipsDescribe the expected behavior
keypoint291should be included inMEDIAPIPE_FACE_MESH_KEYPOINTS_BY_CONTOUR.lipsStandalone code to reproduce the issue
Lips corner not rendered correctly in face-landmarks-detection MediaPipe demo
Other info / logs
I suspect the issue comes from constants.ts. See snippets below:
In particular,
connections.map(connection => connection[0]);eliminateskeypoint291from the indices.This happens because
291appears as the second element in both[375, 291]and[409, 291]whereas61(the other corner of the lips) appears as the first element in both[61, 146]and[61, 185].Hope this helps!