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

Zero to GANs - Course Project

Classifying Cars images using ResNets, Regularization and Data Augmentation in PyTorch

Amir Zbede

Guided mostly with the help of the 6th lecture (https://jovian.ai/aakashns/05b-cifar10-resnet)

More references - help with exploring '.mat' files (https://towardsdatascience.com/how-to-load-matlab-mat-files-in-python-1f200e1287b5)

import os
import torch
import torchvision
import tarfile
import torch.nn as nn
import numpy as np
import pandas as pd
import torch.nn.functional as F
from torchvision.datasets.utils import download_url
from torchvision.datasets import ImageFolder
from torch.utils.data import DataLoader
import torchvision.transforms as tt
from torch.utils.data import random_split
from torchvision.utils import make_grid
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline

matplotlib.rcParams['figure.facecolor'] = '#ffffff'
project_name='course-project'

The Cars Dataset

The Cars dataset contains 16,185 images of 196 classes of cars. The data is split into 8,144 training images and 8,041 testing images, where each class has been split roughly in a 50-50 split. Classes are typically at the level of Make, Model, Year, e.g. 2012 Tesla Model S or 2012 BMW M3 coupe.