如何使用tensorflow.js面部地标检测模型获取面部的特定标志,例如嘴唇或眼睛

2024-01-03

我正在尝试改变眼睛和嘴唇的形状和位置,为此我使用tenserflow.js人脸特征点检测模型 https://github.com/tensorflow/tfjs-models/tree/master/face-landmarks-detection。我得到了所有 468 个面部标志,但问题是我不知道,而且我从未在互联网上找到任何解决方案如何获取仅需要的标志(例如嘴唇和眼睛)的位置。我得到了所有的要点,但想在嘴唇和眼睛上应用更改,我如何仅在这些地标上应用更改。


的坐标可用here https://github.com/tensorflow/tfjs-models/blob/master/face-landmarks-detection/src/mediapipe-facemesh/keypoints.ts.

您可以参考网格图像示例 https://github.com/tensorflow/tfjs-models/tree/master/face-landmarks-detection#keypoints其中也有点,但您需要放大并手动检查它们。

这些是您的用例所需的确切坐标。

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]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用tensorflow.js面部地标检测模型获取面部的特定标志,例如嘴唇或眼睛 的相关文章

随机推荐