| 81 | |
| 82 | class DIODE(Dataset): |
| 83 | def __init__(self, data_dir_root): |
| 84 | import glob |
| 85 | |
| 86 | # image paths are of the form <data_dir_root>/scene_#/scan_#/*.png |
| 87 | self.image_files = glob.glob( |
| 88 | os.path.join(data_dir_root, '*', '*', '*.png')) |
| 89 | self.depth_files = [r.replace(".png", "_depth.npy") |
| 90 | for r in self.image_files] |
| 91 | self.depth_mask_files = [ |
| 92 | r.replace(".png", "_depth_mask.npy") for r in self.image_files] |
| 93 | self.transform = ToTensor() |
| 94 | |
| 95 | def __getitem__(self, idx): |
| 96 | image_path = self.image_files[idx] |