justadudewhohacks / face-api.js

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

Face Recognizer Input Size #7

Open justadudewhohacks opened 6 years ago

justadudewhohacks commented 6 years ago

Allow smaller sizes of face image inputs then 150 x 150.

ksachdeva commented 6 years ago

Hi Vincent,

Curious how this can be achieved ?

I thought that for the dlib's face recognizer model it is mandatory to provide the image size to be 150x150.

See https://github.com/davisking/dlib/blob/master/examples/dnn_face_recognition_ex.cpp#L44

Regards & thanks Kapil

justadudewhohacks commented 6 years ago

Hey kapil, I think the model has just been trained on 150x150 images but you can still pass on images of smaller dimensions. I also used 105x105 images sometimes in face-recogition.js. It doesnt perform as good as 150x150 but still it is possible.

ksachdeva commented 6 years ago

Ok. I had made the assumption that we can not even pass an image smaller than 150x150. Thanks for the clarification.

justadudewhohacks commented 6 years ago

For some reason the dlib net crashed for me when using images smaller than 105x105, so that was the smallest I was able to use.

Bajajar commented 5 years ago

Hi Vincent,

I'm wondering, will you implement MobileNetV2 to retrain the face recognition models?

Best,

justadudewhohacks commented 5 years ago

I was thinking about training a tiny face recognition model at some point, but not sure if I get to do that anytime soon.

Why do you think mobilenet v2 would be a good fit for that?

Bajajar commented 5 years ago

The MobileNetv2's results lie on the curve more than MobileNetv1 one https://github.com/tensorflow/models/tree/master/research/slim/nets/mobilenet

justadudewhohacks commented 5 years ago

Hmm, but the current face recognition net is not a mobilenet, it is a simple resnet. Or did you mean the SSD MobileNet v1 face detector?

Bajajar commented 5 years ago

You are right on the SSD, my bad.

HUYNHVINH2 commented 5 years ago

hi Vincent Which size gives the best performance?