Skip to content

Commit

Permalink
Using tiny models
Browse files Browse the repository at this point in the history
  • Loading branch information
wmodes committed Dec 15, 2023
1 parent 1c2bcd1 commit 14f331b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions faces/js/faces.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ $(document).ready(function() {
// load the models
// await faceapi.loadMtcnnModel('https://wmodes.github.io/webexperiments/faces/models/')
// await faceapi.loadFaceRecognitionModel('https://wmodes.github.io/webexperiments/faces/models/')
await faceapi.nets.ssdMobilenetv1.loadFromUri('https://wmodes.github.io/webexperiments/faces/models/')
await faceapi.nets.faceLandmark68Net.loadFromUri('https://wmodes.github.io/webexperiments/faces/models/')
await faceapi.nets.tinyFaceDetector.loadFromUri('https://wmodes.github.io/webexperiments/faces/models/')
// await faceapi.nets.ssdMobilenetv1.loadFromUri('https://wmodes.github.io/webexperiments/faces/models/')
// await faceapi.nets.faceLandmark68Net.loadFromUri('https://wmodes.github.io/webexperiments/faces/models/')
await faceapi.nets.faceLandmark68TinyNet.loadFromUri('https://wmodes.github.io/webexperiments/faces/models/')
await faceapi.nets.tinyFaceDetector.loadFromUri('https://wmodes.github.io/webexperiments/faces/models/')

// try to access users webcam and stream the images
Expand All @@ -50,7 +50,8 @@ $(document).ready(function() {

/* Display face landmarks */
useTinyModel = true
const detections = await faceapi.detectAllFaces(videoEl).withFaceLandmarks(useTinyModel);
const detections = await faceapi.detectAllFaces(videoEl, new faceapi.TinyFaceDetectorOptions())
.withFaceLandmarks(useTinyModel);

if (detections.length) {
// resize the detected boxes in case your displayed image has a different size than the original
Expand Down

0 comments on commit 14f331b

Please sign in to comment.