Skip to content

Pytorch Dataloader - GTSRB (German Traffic Sign Recognition)

Notifications You must be signed in to change notification settings

tomlawrenceuk/GTSRB-Dataloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

GTSRB Dataloader for Pytorch

Loads the official GTSRB (German Traffic Sign Recognition) training and test sets found here: http://benchmark.ini.rub.de/?section=gtsrb&subsection=dataset

Tested with PyTorch 1.0

Modifications I made to the original dataset to simplify things:

  • Training Set - Created one CSV file containing all image paths and classes
  • Test Set - Created one CSV file containing all image paths and classes

Setup

Usage

Create your PyTorch transforms as required

transform = transforms.Compose([
    transforms.Resize((32, 32)),
    transforms.ToTensor(),
    transforms.Normalize((0.3403, 0.3121, 0.3214),
                         (0.2724, 0.2608, 0.2669))
])

Create Dataset

trainset = dataset.GTSRB(
    root_dir='./data', train=True,  transform=transform)
testset = dataset.GTSRB(
    root_dir='./data', train=False,  transform=transform)

Use dataset with PyTorch Dataloader

trainloader = torch.utils.data.DataLoader(
    trainset, batch_size=128, shuffle=True, num_workers=2)
testloader = torch.utils.data.DataLoader(
    testset, batch_size=128, shuffle=False, num_workers=2)

About

Pytorch Dataloader - GTSRB (German Traffic Sign Recognition)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages