PyTorch includes a package called torchvision which is used to load and prepare the dataset. It includes two basic functions namely Dataset and DataLoader which helps in transformation and loading of dataset.

Dataset

Dataset is used to read and transform a datapoint from the given dataset. The basic syntax to implement is mentioned below −

trainset = torchvision.datasets.CIFAR10(root = './data', train = True,


DataLoader is used to shuffle and batch data. It can be used to load the data in parallel with multiprocessing workers.

trainloader = torch.utils.data.DataLoader(trainset, batch_size = 4,
shuffle = True, num_workers = 2)


landmarks_frame = pd.read_csv('faces/face_landmarks.csv')