ZhaoJ9014 / face.evoLVe

🔥🔥High-Performance Face Recognition Library on PaddlePaddle & PyTorch🔥🔥
MIT License
3.45k stars 758 forks source link

how to create your lfw aligned 112x112 dataset? #116

Open HoangTienDuc opened 4 years ago

HoangTienDuc commented 4 years ago

There are some images that contain more than 1 face. How did you filter out unwanted faces?

Hzzone commented 4 years ago

I have tried the face align script provided by the author to preprocess lfw, and I cannot get a similar result as reported one. I found that the aligned image is a little different from downloaded here, and when I downloaded from cosface[https://awesomeopensource.com/project/yule-li/CosFace], it works.....................

Hzzone commented 4 years ago

After trying to visualize the results aligned by the code here, I found it did not work.

Following is the image aligned by the code here with LFW dataset:

image

Hzzone commented 4 years ago

I recommend using TF MTCNN to detect faces, and remove extra faces like insightface.

HoangTienDuc commented 4 years ago

thank for your advice.

JoMe2704 commented 3 years ago

The function detect_faces in detector.py gives a list of bounding boxes and landmark sets, where each entry of the list corresponds to a face detected. You can iterarate through all detected faces or use just the first. If you are only interested in the largest face in the image, you can set min_face_size to a value (potentially dependent on the image dimension) large enough to eliminate all other faces. For instance, you can set min_face_size = np.float(pil_image.size[0])/4 to detect only faces that are at least 1/4 of image width wide.

For alignment and cropping, please see my response to issue #138.