def load_LFdata(dir_LFimages, hci_root):
    traindata_all = np.zeros((len(dir_LFimages), 512, 512, 9, 9, 3), np.uint8)
    traindata_label = np.zeros((len(dir_LFimages), 512, 512), np.float32)
    image_id = 0
    for dir_LFimage in dir_LFimages:
        print(dir_LFimage)
        for i in range(81):
            try:
                tmp = np.float32(imageio.imread(((hci_root + dir_LFimage) + ('/input_Cam0%.2d.png' % i))))
            except:
                print(((hci_root + dir_LFimage) + ('/input_Cam0%.2d.png..does not exist' % i)))
            traindata_all[image_id, :, :, (i // 9), (i - (9 * (i // 9))), :] = tmp
            del tmp
        try:
            tmp = np.float32(read_pfm(((hci_root + dir_LFimage) + '/gt_disp_lowres.pfm')))
        except:
            print(((hci_root + dir_LFimage) + ('/gt_disp_lowres.pfm..does not exist' % i)))
        traindata_label[image_id, :, :] = tmp
        del tmp
        image_id = (image_id + 1)
    return (traindata_all, traindata_label)
def load_LFdata(dir_LFimages, hci_root):
    traindata_all = np.zeros((len(dir_LFimages), 512, 512, 9, 9, 3), np.uint8)
    traindata_label = np.zeros((len(dir_LFimages), 512, 512), np.float32)
    image_id = 0
    for dir_LFimage in dir_LFimages:
        print(dir_LFimage)
        for i in range(81):
            try:
                tmp = np.float32(imageio.imread(((hci_root + dir_LFimage) + ('/input_Cam0%.2d.png' % i))))
            except:
                print(((hci_root + dir_LFimage) + ('/input_Cam0%.2d.png..does not exist' % i)))
            traindata_all[image_id, :, :, (i // 9), (i - (9 * (i // 9))), :] = tmp
            del tmp
        try:
            tmp = np.float32(read_pfm(((hci_root + dir_LFimage) + '/gt_disp_lowres.pfm')))
        except:
            print(((hci_root + dir_LFimage) + ('/gt_disp_lowres.pfm..does not exist' % i)))
        traindata_label[image_id, :, :] = tmp
        del tmp
        image_id = (image_id + 1)
    return (traindata_all, traindata_label)