Beispiel #1
0
    def __getitem__(self, index):
        img = self.list_files[index]
        img_path = os.path.join(self.root_dir, img)
        image = np.array(Image.open(img_path))
        input_image = image[:, :600]  # images are 1200xsomething
        target_image = image[:, 600:]
        augmentations = config.both_transform(image=input_image,
                                              image0=target_image)
        input_image, target_image = augmentations["image"], augmentations[
            "image0"]
        input_image = config.transform_only_input(image=input_image)["image"]
        target_image = config.transform_only_mask(image=target_image)["image"]

        return input_image, target_image
Beispiel #2
0
    def __getitem__(self, index):
        img_file = self.list_files[index]
        img_path = os.path.join(self.root_dir, img_file)
        image = np.array(Image.open(img_path))
        input_image = image[:, :512, :]  #
        target_image = image[:, 512:, :]

        augmentations = config.both_transform(image=input_image,
                                              image0=target_image)
        input_image = augmentations["image"]
        target_image = augmentations["image0"]

        input_image = config.transform_only_input(image=input_image)["image"]
        target_image = config.transform_only_mask(image=target_image)["image"]

        return input_image, target_image
Beispiel #3
0
    def __getitem__(self, index):
        img_file = self.list_files[index]
        img_path = os.path.join(self.root_dir, img_file)
        image = np.array(Image.open(img_path))
        # Split image by half
        input_image = image[:, :600, :]
        target_image = image[:, 600:, :]
        # Data augmentation
        augmentations = config.both_transform(image=input_image,
                                              image0=target_image)
        input_image, target_image = augmentations["image"], augmentations[
            "image0"]

        input_image = config.transform_only_input(image=input_image)["image"]
        target_image = config.transform_only_input(image=target_image)["image"]

        return input_image, target_image
Beispiel #4
0
    def __getitem__(self, index):
        img_file_A = self.list_files_A[index]
        img_file_B = self.list_files_B[index]

        img_path_A = os.path.join(self.A_folder, img_file_A)
        img_path_B = os.path.join(self.B_folder, img_file_B)

        input_image = np.array(Image.open(img_path_A))
        target_image = np.array(Image.open(img_path_B))

        augmentations = config.both_transform(image=input_image,
                                              image0=target_image)

        input_image = augmentations["image"]
        target_image = augmentations["image0"]

        input_image = config.transform_only_input(image=input_image)["image"]
        target_image = config.transform_only_mask(image=target_image)["image"]

        return input_image, target_image