MCPcopy Create free account
hub / github.com/M-Nauta/ProtoTree / get_data

Function get_data

util/data.py:13–28  ·  view source on GitHub ↗

Load the proper dataset based on the parsed arguments :param args: The arguments in which is specified which dataset should be used :return: a 5-tuple consisting of: - The train data set - The project data set (usually train data set without augmenta

(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

11
12
13def get_data(args: argparse.Namespace):
14 """
15 Load the proper dataset based on the parsed arguments
16 :param args: The arguments in which is specified which dataset should be used
17 :return: a 5-tuple consisting of:
18 - The train data set
19 - The project data set (usually train data set without augmentation)
20 - The test data set
21 - a tuple containing all possible class labels
22 - a tuple containing the shape (depth, width, height) of the input images
23 """
24 if args.dataset =='CUB-200-2011':
25 return get_birds(True, './data/CUB_200_2011/dataset/train_corners', './data/CUB_200_2011/dataset/train_crop', './data/CUB_200_2011/dataset/test_full')
26 if args.dataset == 'CARS':
27 return get_cars(True, './data/cars/dataset/train', './data/cars/dataset/train', './data/cars/dataset/test')
28 raise Exception(f'Could not load data set "{args.dataset}"!')
29
30def get_dataloaders(args: argparse.Namespace):
31 """

Callers 1

get_dataloadersFunction · 0.85

Calls 2

get_birdsFunction · 0.85
get_carsFunction · 0.85

Tested by

no test coverage detected