def get_data(self, dataset: tk.data.Dataset, index: int): X, y = dataset.get_data(index) X = tk.ndimage.load(X) X = self.aug1(image=X)["image"] y = tf.keras.utils.to_categorical( y, num_classes) if y is not None else None return X, y
def get_data(self, dataset: tk.data.Dataset, index: int): X, y = dataset.get_data(index) X = tk.ndimage.load(X) if self.mask: y = tk.ndimage.load(y) a = self.aug(image=X, mask=y) X = a["image"] y = a["mask"] else: a = self.aug(image=X) X = a["image"] return X, y