Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
Find best match with @vladmandic/face-api does not work well

I tested compare on few images and it works, when I tested on 6500 pictures it is not working. What do I miss? I get this result:

 {
            "sucesss": true,
            "bestMatchPerson": {
                "_label": "unknown",
                "_distance": 0.653006573156487
            }
        }

Here is the code sample that loads model, loads image from disk, creates face matcher, and finds best match

    // 1, Load model
     faceapi.env.monkeyPatch({ Canvas: canvas.Canvas, Image: canvas.Image, ImageData: canvas.ImageData });
          const faceDetectionNet = new faceapi.FaceDetectionNet();
          const modelPath = '../../node_modules/@vladmandic/face-api/model';
          await faceDetectionNet.loadFromDisk(path.join(__dirname, modelPath));
          await faceapi.nets.ssdMobilenetv1.loadFromDisk(path.join(__dirname, modelPath));
          await faceapi.nets.faceLandmark68Net.loadFromDisk(path.join(__dirname, modelPath));
          awai
    t faceapi.nets.faceRecogn

itionNet.loadFromDisk(path.join(__dirname, modelPath));
   
      // 2.Load image from disk
     console.log(imagePath);
      const referenceImage = await canvas.loadImage(imagePath);
// 3.Create face matcher
     const singleResult = await faceapi
       .detectSingleFace(referenceImage)
       .withFaceLandmarks()
       .withFaceDescriptor()

     //4.Find best match
     let labeledFaceDescriptors = singeltonCache.get("BbtFaceMatcher");
     let bestMatchPerson ='There is no people to compare to';
     if(labeledFaceDescriptors){
     let matcher = new faceapi.FaceMatcher(labeledFaceDescriptors);
     bestMatchPerson = matcher.findBestMatch(singleResult.descriptor);
     utils.logger.log({
       level: 'info',
       message: `compare all: ${"The results " + bestMatchPerson.toString()}`,
       label: 'faceRecognition.ts'
     });
   }
   else{
     utils.logger.log({
       level: 'info',
       message: `compare all: There is no people to compare to}`,
       label: 'faceRecognition.ts'
     });
   }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!