We will use MTCNN package to detect faces in a image and then feed all the faces detected to the nueral network to predict the cropped image into mask or no_mask class. The data to train the model is taken from Mask Detection which consists of annotations and images. Custom Neural Network is used to train the network and the accuracy on train and test data is 92% on average.
To increase the accuracy and model's performace you can add more images in the dataset and using Transfer Learning can also boost the model's accuracy further.
You can use the model to predict in real time by using the code Real Time Detection . You can use this code in any local python ide which supports using your camera. I have used Pycharm to use the model in real time.
You can also download my model's weight from the Google Drive. Additionally you would need to install libraries such as keras, cv , mtcnn in your python ide.