Learn practical skills, build real-world projects, and advance your career
!pip install jovian --upgrade --quiet

Face Mask Detection

Dataset Credits -> https://www.kaggle.com/omkargurav/face-mask-dataset

2020 has been a tough year for everyone.
Let's try to work on something that can help us get through this time and build a safer and better tomorrow by applying what we learnt to promote awareness and safety measures.

Face Masks have become mandatory all across the world. With this small image dataset, lets try to use Deep Learning to detect faces with and without masks.

The dataset has 7553 images with 3 color channels(RGB).

Let's experiment with our how we can apply our learnings to create an optimal classification model that can identify if a person is wearing a mask or not.

import os
from google.colab import files
import pandas as pd
import torch
import torchvision
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import torch.nn as nn
from datetime import datetime
import torch.nn.functional as F
from torchvision.datasets import CIFAR10, ImageFolder
from torchvision.transforms import ToTensor
import torchvision.transforms as tt
from torchvision.utils import make_grid
from torchvision.datasets.utils import download_url
from torch.utils.data import DataLoader, TensorDataset, random_split
from PIL import Image
import requests

#import kaggle
%matplotlib inline
# Project name used for jovian.commit
project_name = 'my-face-mask-project'

Getting the Dataset

Lets use te JovianML opendatasets python library for downloading Kaggle and Google Drive datasets using a simple python command.