The number of people affected by the covid-19 is just increasing in a tremendous rate . Due to this many countries are facing economic crisis, famine and much more. One of the things we could do is social distancing, staying at home isolating ourselves from the outside world. But that is not an option anymore, people need to earn to live, no one can stay inside home forever. They are bound to leave the house eventually. As a precaution people can wear mask maintaining social distancing, but there are some people who neglects those things and walk around like nothings happening.

I created this program to check if people are wearing masks using **Artificial Intelligence **the program can detect people’s face in a crowd. This can be used in mall, airport, railways station, local market, streets etc.

Here’s a glimpse.

Detection inside a room

Detection in a crowd

CNN Architecture

Convolutional Neural Network (ConvNet/CNN) is a Deep Learning algorithm which can take in an input image, assign importance (learnable weights and biases) to various aspects/objects in the image and be able to differentiate one from the other. The pre-processing required in a ConvNet is much lower as compared to other classification algorithms. While in primitive methods filters are hand-engineered, with enough training, ConvNets have the ability to learn these filters/characteristics.

def conv_block(in_channels, out_channels, pooling=False):
	        '''
	        params: in_channels: (int) number of input channels
	        params: out_channels: (int) number of output channels
	        params: pooling: (bool) use pooling or not
	        return: convolutional layers
	        '''
	        conv_layers = nn.Sequential(
	            nn.Conv2d(in_channels, out_channels, kernel_size=3, padding=1, stride=1),
	            nn.BatchNorm2d(out_channels),
	            nn.ReLU()
	            )
	        if pooling: 
	            conv_layers.add_module('max_pooling',nn.MaxPool2d(2))
	        return conv_layers

#jovian-ml #facedetection #python #freecodecamp #pytorch

Face-Mask-Detection using PyTorch
19.95 GEEK