Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
According to issue #1274, this PR extends the usage of
from_mediapipe
function to support FaceMesh.Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
The following Google Colab describes the process used for testing this new feature. It allows to upload a picture to test it. (This Colab feature only worked in Chrome for me).
The first part of the Colab is the examples from the PoseLandmaker to ensure that this functionality is still working after the new changes.
Any specific deployment considerations
As discussed in the issue thread, I created two Skeletons:
FACEMESH_TESSELATION_NO_IRIS
andFACEMESH_TESSELATION
to support the legacy code with optional refinement of the iris. However, there is a minor difference between the skeletons described in the mediapipe library and the ones in this PR. The skeletons represent the connections between each point on them, but there are 2 points out of the 478 that do not have a connection (the centre of the iris). Since theEdgeAnnotator
class uses the SKELETONS_BY_VERTEX_COUNT variable for counting unique vertices in the skeleton, I connected each center to itself to have a unique vertex count of 478. This can be appreciate in the Google Colab notebook.The code was updated to look for the correct inference result using the
hasattr
method, which makes easier to integrate theHandLandmarker
results in the future (if it is planned).The docstring was updated to add a
FaceLandmarker
inference example. (The lines are probably too long but the pre-commit won't reformat)Docs