The 2019-nCoV can be transmitted through respiratory droplets and other methods, which greatly endangers public health security. Wearing masks correctly has been proven to be one of the effective means to prevent virus infection, but limited by the complexity of practical application scenarios, the wearing of masks still relies heavily on manual supervision. Therefore, a fast and accurate face mask wearing detection method is urgently needed. In this paper, a mask detection algorithm based on improved YOLO-v4 is proposed as a solution to the problems of low accuracy, poor real-time performance, and poor robustness caused by complicated environments. In addition, a number of different training approaches, such as mosaic data augment, CIOU, label smoothing, cosine annealing, etc., are introduced. These techniques help to increase the training speed of the model as well as the accuracy of its detection. With a fast-training model, the model will be able to detect and compare the results of samples from different scenarios. The experiment will compare front and side faces, different colored masks, scenes of varying complexity and other perspectives in a systematic way. The experiment's result was able to reach 99.38 % accuracy after the model was trained using data from a variety of face masks being worn. Experiment results, both quantitative and qualitative, indicate that the method can be adapted to most scenarios and offers effective ideas for improvement.