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

Predicting the Age of Facial Images

This notebook contains a regression model to predict age from facial images

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
##from fastai.vision import *
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: ··········
4%|▎ | 31.0M/840M [00:00<00:02, 322MB/s]
Downloading facial-age.zip to ./facial-age
100%|██████████| 840M/840M [00:02<00:00, 305MB/s]