Learn practical skills, build real-world projects, and advance your career

Human Face Eppressions Detection

In this project, We build a Convolutional Neural Network that can classify the different facial expression that humans make. The dataset used here is obtained from this Kaggle page.

Importing necessary modules

!pip install jovian --upgrade --quiet
WARNING: You are using pip version 20.3.1; however, version 20.3.3 is available. You should consider upgrading via the '/opt/conda/bin/python3.7 -m pip install --upgrade pip' command.
import torch
from torch.utils.data import random_split
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision.datasets import ImageFolder
import torchvision.transforms as transforms
from torch.utils.data.dataloader import DataLoader
from torchvision.utils import make_grid
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import jovian
import os

The dataset mentioned above was downloaded from Kaggle. This dataset containes images of humans with 7 different expressions.

They are:

  • angry
  • disgust
  • fear
  • happy
  • neutral
  • sad and
  • surprise

This is a classification task where we are to build a model that can classify the different facial expressions of humans.

first we'll load the dataset and explore it.