(self, pickle_path, aug_flag=True)
| 220 | self.embedding_filename = '/skip-thought-embeddings.pickle' |
| 221 | |
| 222 | def get_data(self, pickle_path, aug_flag=True): |
| 223 | with open(pickle_path + self.image_filename, 'rb') as f: |
| 224 | images = pickle.load(f) |
| 225 | images = np.array(images) |
| 226 | print('images: ', images.shape) |
| 227 | |
| 228 | with open(pickle_path + self.embedding_filename, 'rb') as f: |
| 229 | embeddings = pickle.load(f) |
| 230 | embeddings = np.array(embeddings) |
| 231 | self.embedding_shape = [embeddings.shape[-1]] |
| 232 | print('embeddings: ', embeddings.shape) |
| 233 | with open(pickle_path + '/filenames.pickle', 'rb') as f: |
| 234 | list_filenames = pickle.load(f) |
| 235 | print('list_filenames: ', len(list_filenames), list_filenames[0]) |
| 236 | with open(pickle_path + '/class_info.pickle', 'rb') as f: |
| 237 | class_id = pickle.load(f) |
| 238 | |
| 239 | return Dataset(images, self.image_shape[0], embeddings, |
| 240 | list_filenames, self.workdir, None, |
| 241 | aug_flag, class_id) |
no test coverage detected