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

Classifying Facial Images by Age

This notebook contains a model to classify images of faces by age

Extracting the Data

!pip install jovian --upgrade --quiet
!pip install opendatasets --upgrade --quiet
import opendatasets as od
import os
import shutil
import torch
import pandas as pd
import numpy as np
from torch.utils.data import Dataset, random_split, DataLoader
from PIL import Image
from torchvision.datasets import ImageFolder
import torchvision.models as models
import matplotlib.pyplot as plt
import torchvision.transforms as transforms
import torch.nn.functional as F
import torch.nn as nn
from torchvision.utils import make_grid
%matplotlib inline
dataset_url = 'https://www.kaggle.com/frabbisw/facial-age'
od.download(dataset_url)
Please provide your Kaggle credentials to download this dataset. Learn more: http://bit.ly/kaggle-creds Your Kaggle username: allysong Your Kaggle Key: ··········
1%| | 5.00M/840M [00:00<00:20, 43.2MB/s]
Downloading facial-age.zip to ./facial-age
100%|██████████| 840M/840M [00:19<00:00, 45.5MB/s]