| 5 | |
| 6 | class LoadData(): |
| 7 | def __init__(self,mode): |
| 8 | self.mode = mode |
| 9 | self.datafile = 'data/fc100/FC100_' + self.mode + '.pickle' |
| 10 | print('loading FC100 dataset from {} ......'.format(self.datafile)) |
| 11 | with open(self.datafile, 'rb') as f: |
| 12 | images_labels = pkl.load(f, encoding='latin1') |
| 13 | data = images_labels['data'] # [36000,32,32,3] , random order, datatype = unit8 |
| 14 | self.data = np.transpose(data, [0,3,1,2]) # [36000,3,32,32] |
| 15 | self.label = np.array(images_labels['labels']) # [36000], int |
| 16 | print('FC100 dataset load done') |
| 17 | |
| 18 | def __getitem__(self, index): |
| 19 | return self.data[index], self.label[index] |