Requirement:
-
MatMTCNN. If you are not using Windows, you need to modify some of the codes to directly use the Matlab version of MTCNN. If you have done such a work, I'm glad to merge your codes.
-
Megaface. Please download
Our dataset
,FaceScrub full tgz
,FaceScrub bounding boxes actors txt
,FaceScrub bounding boxes actresses txt
,Linux Development Kit
.
Procedure:
-
Align Facescrub:
align_facescrub.m
. Then mannully confirm some failed samples throughalign_facescrub_failures.m
. -
Align Megaface:
align_megaface_from_list.m
. Then align failed samples throughalign_megaface_failures.m
. -
Extract Features using
extract_facescrub_feature.m
,extract_megaface_feature.m
.
Alignment Logic:
The provided 3-point labels are the most accurate. The second accurate information is the bounding box. All 5-point labels are totally wrong. So our logic is as follows.
align_megaface_from_list.m
: If there is 3-point label, rotate and crop the image according to it. Then detect and align face from the cropped image.align_megaface_failures.m
: If there is no 3-point label or failed to detect from the cropped image, detect face from the raw image.
If the detected face and the given bounding box's IoU is over 30%, align this face.
If the IoU is below 30%, use the last two networks of MTCNN to forcely get the face score and 5 keypoints from the cropped image based on the given bounding box.
If the face score is above 0.3, use the detected 5 points to align the face.
If all methods are failed, directly crop the middle area of a face as the aligned face.