How to get specific landmark of face like lips or eyes using tensorflow.js face-landmark-detection model

I am trying to change the shape and position of eyes and lips and for this purpose I use tenserflow.js face-landmark-detection model. I get the all 468 facial landmarks but the problem is i don't know and i never find any solution on internet how to get the position of only required landmark like lips and eyes. I get all the points but want to apply changes on lips and eyes how i apply changes only on these landmarks.


Solution 1:

The coordinates of are available here.

You can refer to the mesh image example which has the points as well but you would need to zoom in and check them manually.

These are the exact coordinates that you would need for your use case.

lipsUpperOuter: [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291]
lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291]
lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308]
lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308]
rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173]
rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133]
rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190]
rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243]
rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189]
rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244]
rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245]
rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193]
rightEyebrowLower: [35, 124, 46, 53, 52, 65]
rightEyeIris: [473, 474, 475, 476, 477]
leftEyeUpper0: [466, 388, 387, 386, 385, 384, 398]
leftEyeLower0: [263, 249, 390, 373, 374, 380, 381, 382, 362]
leftEyeUpper1: [467, 260, 259, 257, 258, 286, 414]
leftEyeLower1: [359, 255, 339, 254, 253, 252, 256, 341, 463]
leftEyeUpper2: [342, 445, 444, 443, 442, 441, 413]
leftEyeLower2: [446, 261, 448, 449, 450, 451, 452, 453, 464]
leftEyeLower3: [372, 340, 346, 347, 348, 349, 350, 357, 465]
leftEyebrowUpper: [383, 300, 293, 334, 296, 336, 285, 417]
leftEyebrowLower: [265, 353, 276, 283, 282, 295]
leftEyeIris: [468, 469, 470, 471, 472]