Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
fustyles authored Oct 10, 2023
1 parent 5e174c3 commit a21527d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ function loadCaptureImages() {
facelabels.map(async function(label, index) {
const descriptions = []
var n = prompt("Label name");
if (n) {
context.drawImage(source,0,0,source.width,source.height);
if (n!==""&&n!== null) {
context.drawImage(source,0,0,source.width,source.height);
var img = document.createElement('img');
img.src = canvas.toDataURL("image/jpeg", 1.0);
const detections = await faceapi.detectSingleFace(img).withFaceLandmarks().withFaceDescriptor();
descriptions.push(detections.descriptor);
descriptions.push(detections.descriptor);
return new faceapi.LabeledFaceDescriptors(n, descriptions);
}
})
)
}
}

0 comments on commit a21527d

Please sign in to comment.