Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add p5 example sketches #144

Merged
merged 1 commit into from
Jun 20, 2024
Merged

add p5 example sketches #144

merged 1 commit into from
Jun 20, 2024

Conversation

ziyuan-linn
Copy link
Member

This PR adds a few faceMesh example sketches provided by @MOQN. These examples should help break down the overwhelming amount of keypoints faceMesh provides. These examples should be live on the web editor after merging this PR and running the p5 upload script.

I tested the examples and they all work great! However, the custom shapes example does not seem to draw the lips correctly.

Screenshot 2024-06-18 220851

I haven't done a closer investigation, but I wonder if the problem is related to #107.

Co-Authored-By: J.H. Moon <[email protected]>
@gohai
Copy link
Member

gohai commented Jun 19, 2024

@ziyuan-linn I believe we encountered the lips issue before in #67 and 5734120.

Google's tf.js-models code has a list of point-pairs between which one ought to draw a line to arrive at the desired contour.
Our data structure isn't so sophisticated - we try to do a good job now returning the points a meaningful order, but we we can't express e.g. interruptions of the line.

If this is necessary one could either switch to an array of an array of points ([[{x: 1, y: 2}, ... ], [{x: 2, y: 3}, ... ], ... ]) - or to a flat array of line segments ([{x1: 1, y1: 1, x2: 2, y2: 2}, ...]).

@shiffman
Copy link
Member

These examples are great!

@shiffman
Copy link
Member

Merging, we can address the custom shapes example separately, feel free to open an issue for tracking @ziyuan-linn!

@shiffman shiffman merged commit 5bee620 into main Jun 20, 2024
@ziyuan-linn ziyuan-linn deleted the add-example-sketches branch July 3, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants