Pretrained model for face detection

Is there any pre-trained model for face detection in pytorch using deep learning approach?
Note:- Not using haar cascade or viola jones using openCV

Here you go, https://github.com/timesler/facenet-pytorch I have not used this personally. you might face issues or might not but you need to take forward from here.

@Naveen_Kumar thanks for ur input but facenet is for face recognition and I want for face detection…but anyways I got it :slight_smile:

The repo linked above by @Naveen_Kumar includes both face detection and recognition (as do many facial recognition libraries). It uses a pretrained MTCNN network for the detection.

Disclaimer: https://github.com/timesler/facenet-pytorch is my repo

1 Like

I’m newbie so not sure what’s the right way to get help about this @timesler . I tried using your package but I got the following error:
moduleNotFoundError: No module named ‘torchvision.ops’

I’m using miniconda and installed pytorch using conda but your package using pip. Not sure if that’s causing an issue. I’m using
python 3.7.11
pytorch 1.9.0
torchvision 0.2.2
facenet-pytorch 2.5.2

This release is quite old as the latest torchvision release is 0.13.1 so you might want to update it.

1 Like

@timesler
I am unable to export the mtcnn model from facenet-pytorch repo into ONNX model as it does lot of operations outside the 3 stage models(p,o,r nets) and uses numpy arrays instead of torch arrays. Any ideas of making conversion to ONNX model ?