def __getitem__(self, index):
    'Return a data point and its metadata information.\n\n        Parameters:\n            index (int)      -- a random integer for data indexing\n\n        Returns a dictionary that contains A, B, A_paths and B_paths\n            A (tensor)       -- an image in the input domain\n            B (tensor)       -- its corresponding image in the target domain\n            A_paths (str)    -- image paths\n            B_paths (str)    -- image paths\n        '
    A_path = self.A_paths[(index % self.A_size)]
    if self.opt.serial_batches:
        index_B = (index % self.B_size)
    else:
        index_B = random.randint(0, (self.B_size - 1))
    B_path = self.B_paths[index_B]
    A_img = np.array(Image.open(A_path).convert('RGB'))
    A_img = self.stack(A_img)
    try:
        B_img = self.hsi_loader(B_path)
    except KeyError:
        print(B_path)
    B = normalize(B_img, max_=4096)
    A = normalize(A_img, max_=1)
    A = adaptive_instance_normalization(A, B)
    del A_img, B_img
    return {'A': A, 'B': B, 'A_paths': A_path, 'B_paths': B_path}
Return a data point and its metadata information.

Parameters:
    index (int)      -- a random integer for data indexing

Returns a dictionary that contains A, B, A_paths and B_paths
    A (tensor)       -- an image in the input domain
    B (tensor)       -- its corresponding image in the target domain
    A_paths (str)    -- image paths
    B_paths (str)    -- image paths
def __getitem__(self, index):
    'Return a data point and its metadata information.\n\n        Parameters:\n            index (int)      -- a random integer for data indexing\n\n        Returns a dictionary that contains A, B, A_paths and B_paths\n            A (tensor)       -- an image in the input domain\n            B (tensor)       -- its corresponding image in the target domain\n            A_paths (str)    -- image paths\n            B_paths (str)    -- image paths\n        '
    A_path = self.A_paths[(index % self.A_size)]
    if self.opt.serial_batches:
        index_B = (index % self.B_size)
    else:
        index_B = random.randint(0, (self.B_size - 1))
    B_path = self.B_paths[index_B]
    A_img = np.array(Image.open(A_path).convert('RGB'))
    A_img = self.stack(A_img)
    try:
        B_img = self.hsi_loader(B_path)
    except KeyError:
        print(B_path)
    B = normalize(B_img, max_=4096)
    A = normalize(A_img, max_=1)
    A = adaptive_instance_normalization(A, B)
    del A_img, B_img
    return {'A': A, 'B': B, 'A_paths': A_path, 'B_paths': B_path}