def setup(self, limit=None): if limit is not None and limit < 1: raise datasets.DatasetException('Limit must be at least 1.') # raw experimental images self.x = self._list_images('exp', limit) # ground truth self.y = self._list_images('ground', limit) self.on_epoch_end()
def load(self, limit=None): if limit is not None: if limit < 4: raise datasets.DatasetException('Limit must be at least 4.') limit = np.floor(limit / 4) # noisy dataset self.X_train = np.array( self.load_images_from_dir('dipoles_hc_noise', limit) + self.load_images_from_dir('dipoles_lc_noise', limit) + self.load_images_from_dir('dipoles_vlc_noise', limit) + self.load_images_from_dir('constants_noise', limit) ) # clean dataset self.Y_train = np.array( self.load_images_from_dir('dipoles_hc', limit) + self.load_images_from_dir('dipoles_lc', limit) + self.load_images_from_dir('dipoles_vlc', limit) + self.load_images_from_dir('constants', limit) )