A new and deadly virus known as SARS-CoV-2, which is responsible for the coronavirus disease (COVID-19), is spreading rapidly around the world causing more than 4 million deaths. Hence, there is an urgent need to find new and innovative ways to reduce the likelihood of infection. One of the most common ways of catching the virus is by being in contact with droplets delivered by a sick person. The risk can be reduced by wearing a face mask as sugges-ted by the World Health Organization (WHO), especially in closed environments such as classrooms, hospitals, and supermarkets. However, people hesitate to use a face mask leading to an increase in the risk of spreading the disea-se, moreover when the face mask is used, sometimes it is worn in the wrong way. In this work, an autonomic face mask detection system with deep learning and powered by the image tracking technique used for the augmented reality development is proposed as a mechanism to request the correct use of face masks to grant access to people to critical areas. To achieve this, a machine learning model based on Convolutional Neural Networks was built on top of an IoT framework to enforce the correct use of the face mask in required areas as it is requested by law in some regions.