Face detection technology is widely used in various fields, such as security systems and authentication systems. In the current stage of normalized epidemic prevention and control, people need to wear masks in public. A new approach is urgently needed to enable face detection when people wear masks. First, according to the public dataset Widerface and MAFA, this paper uses a Dlib-based way to obtain a self-built dataset and label them. Second, we have made the following innovations to the YOLOv3 face detection algorithm. The original Darknet-53 is replaced with ResNet50 as the backbone network, where DCN(Deformable Convolutional Network) enhances the robustness of the model to slightly deformed targets. At the same time, the FPN(Feature Pyramid Network) is replaced by BiFPN(Bidirectional Feature Network) and DIoU(Distance IoU) is introduced as a positioning loss function. Third, after changing faceNet's loss function to ArcFace, two models are trained using FaceNet: a mask-wearing face and a normal face. Experiments show that the face detection model proposed in this paper has an mAP50(mean Average Precision) of 94.68%, which is 2.53% higher than the original YOLOv3 model. Through multi-model with different weights selected by self-determination, the face recognition can maximize the use of the current facial feature points and achieve a more superior face identity recognition effect.