def __getitem__(self, index):
    left_img = self.load_image(os.path.join(self.datapath, self.left_filenames[index]))
    right_img = self.load_image(os.path.join(self.datapath, self.right_filenames[index]))
    if self.disp_filenames:
        disparity = self.load_disp(os.path.join(self.datapath, self.disp_filenames[index]))
    else:
        disparity = None
    processed = get_transform()
    left_img = processed(left_img)
    right_img = processed(right_img)
    return {'left': left_img, 'right': right_img, 'top_pad': 0, 'right_pad': 0, 'left_filename': self.left_filenames[index]}
def __getitem__(self, index):
    left_img = self.load_image(os.path.join(self.datapath, self.left_filenames[index]))
    right_img = self.load_image(os.path.join(self.datapath, self.right_filenames[index]))
    if self.disp_filenames:
        disparity = self.load_disp(os.path.join(self.datapath, self.disp_filenames[index]))
    else:
        disparity = None
    processed = get_transform()
    left_img = processed(left_img)
    right_img = processed(right_img)
    return {'left': left_img, 'right': right_img, 'top_pad': 0, 'right_pad': 0, 'left_filename': self.left_filenames[index]}