Learn practical skills, build real-world projects, and advance your career
import os
import torch
import pandas as pd
import numpy as np
from torch.utils.data import Dataset, random_split, DataLoader
from PIL import Image
import torchvision.models as models
import matplotlib.pyplot as plt
import torchvision.transforms as transforms
from sklearn.metrics import f1_score
import torch.nn.functional as F
import torch.nn as nn
from torchvision.utils import make_grid
%matplotlib inline

Extracting the data

In this segment I'll create the paths to read the data, the dictionary to label the data and a function to create the data frame.

TEST_DIR = '../input/100-bird-species/test/'
TRAIN_DIR = '../input/100-bird-species/train/'
VALID_DIR = '../input/100-bird-species/valid/'
label_dict = {
    0: 'Mallard duck',
    1: 'Mandrin duck',
    2: 'Red headed duck',
    3: 'Teal duck',
    4: 'Steamer duck',
    5: 'Emu',
    6: 'Ostrich',
    7: 'Javan magpie',
    8: 'Taiwan magpie',
    9: 'Eurasian magpie'
}
print(label_dict)