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

Posenet instead of facemesh in the comments #1210

Merged
merged 1 commit into from
Aug 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/p5js/Facemesh/Facemesh_Image/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function setup() {
frameRate(1); // set the frameRate to 1 since we don't need it to be running quickly in this case
}

// when the image is ready, then load up poseNet
// when the image is ready, then load up facemesh
function imageReady() {
facemesh = ml5.facemesh(modelReady);

Expand All @@ -24,18 +24,18 @@ function imageReady() {
});
}

// when poseNet is ready, do the detection
// when facemesh is ready, do the detection
function modelReady() {
console.log("Model ready!");
facemesh.predict(img);
}

// draw() will not show anything until poses are found
// draw() will not show anything until the face is found
function draw() {
if (predictions.length > 0) {
image(img, 0, 0, width, height);
drawKeypoints();
noLoop(); // stop looping when the poses are estimated
noLoop(); // stop looping when the face is estimated
}
}

Expand All @@ -44,7 +44,7 @@ function drawKeypoints() {
for (let i = 0; i < predictions.length; i += 1) {
const keypoints = predictions[i].scaledMesh;

// Draw facial keypoints.
// Draw keypoints.
for (let j = 0; j < keypoints.length; j += 1) {
const [x, y] = keypoints[j];

Expand Down