2021年4月7日水曜日

Identify the position from the key point number in Facemesh

This article is a sequel to "Using the MIT App Inventor Facemesh Extension". In Facemesh, the key points of the face are numbered from 1 to 450, and the map that associates the number with the position in the face is provided by Google on GitHub. However, at present, this map does not show the correct position in the face (probably due to version upgrade). Therefore, I made a tool to get the correspondence between the number and the actual position.

Most desirable is to get that number by touching a Facemesh key point. However, there are 450 points in total, including dense parts, so even if it is enlarged, it is difficult to operate it on the screen of the smartphone. Therefore, as a second method, I decided to search for the necessary key points while increasing or decreasing the number. In this case, a partial map that is already known (like the handwritten map in Fig. 1) is useful.

In the Fig.1, start from the specified value (255 in the figure), and increase or decrease the number with the "+" and "-" buttons. This makes it easy to search around 255, for example. In this example, the red dot for number 256 is clearly visible among the green keypoints. This app also uses the Facemesh extension from MIT App Inventor. Fig.2 shows the main parts of the program. I won't explain it in detail, but it's fairly easy to make because it uses Ball, which is an animation function of App Inventor.

In fact, in the "mask wearing" shown in the previous task [Exercise-1], the key points that form the periphery of the mask were acquired by the above method.

0 件のコメント:

コメントを投稿