-
Notifications
You must be signed in to change notification settings - Fork 2
/
data.py
26 lines (21 loc) · 943 Bytes
/
data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sys
import mini_imagenet
"""
General function that selects and initializes the particular dataset to use for
few-shot classification. Additional dataset support should be added here.
"""
def get_data(dataset, mode='train', seed=1):
if dataset == 'Omniglot':
return omniglot.OmniglotData(path='../data/omniglot.npy',
train_size=1100,
validation_size=100,
augment_data=True,
seed=seed)
elif dataset == 'miniImageNet':
return mini_imagenet.MiniImageNetData(path='../data', seed=seed)
elif dataset == 'cifarfs':
return cifar_fs.CifarData(path='../data', seed=seed)
elif dataset == 'tieredImageNet':
return tiered_imagenet.tieredImageNetData(path='../data', seed=seed)
else:
sys.exit("Unsupported dataset type (%s)." % dataset)