justadudewhohacks / face-api.js

JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js
MIT License
16.7k stars 3.71k forks source link

Error of "no faces detected for label" with 400 face images #225

Open larui529 opened 5 years ago

larui529 commented 5 years ago

Hi

I am trying to use tiny face model to do a face recognition api with 400 different faces. But I got "no faces detected for labels" error when I chose any input size larger than 128. The accuracy of the model is not very good based on the small input size. I am wondering if there is any solution to that. Thanks.

Rui

justadudewhohacks commented 5 years ago

"no faces detected for labels " where does this Error come from?

Please share some example images, so I can verify the issue. Also you can try out the SSD mobilenetv1 model for face detection.

slash-dev commented 5 years ago

I experienced a similar problem following the example at https://itnext.io/face-api-js-javascript-api-for-face-recognition-in-the-browser-with-tensorflow-js-bcc2a6c4cf07

I'm loading the following models: await faceapi.loadSsdMobilenetv1Model(); await faceapi.loadFaceLandmarkModel(); await faceapi.loadFaceRecognitionModel();

I tried the following. I take one image with multiple people. I run the face detection. I then save the images of the faces (a little bit unzoomed to see a bit more the person). Then I ran faceapi.detectSingleFace() on each of these images of a single face and it didn't find any face on any of the images. Which is quite interesting since those are actual faces that I found using the same library.

I think the problem comes from the size of the images. The faces were extracted from a picture with many people and the resulting "single face" image are quite small and a bit blurry.

I tried the following 2 things:

I'm a bit surprised that it doesn't find faces at all when it actually extracted from the same library. I guess the models are not the same for both functions.

Thank you very much for all your work, this library is amazing!