(self, index)
| 104 | return len(self.all_frames) |
| 105 | |
| 106 | def __getitem__(self, index): |
| 107 | set_idx, image_path, timestamp, frame_idx = self.all_frames[index] |
| 108 | |
| 109 | if not osp.exists(image_path): |
| 110 | raise FileNotFoundError(f"Image not found: {image_path}") |
| 111 | |
| 112 | frame = Image.open(image_path).convert("RGB") |
| 113 | depth = Image.open(image_path).convert("RGB") |
| 114 | |
| 115 | depth = resize_to_shorter_side(depth) |
| 116 | |
| 117 | depth = resize_to_multiple_of_14(depth) |
| 118 | |
| 119 | frame = self.transform(frame) |
| 120 | depth = self.transform(depth) |
| 121 | |
| 122 | results = { |
| 123 | "frames": frame, |
| 124 | "depths": depth, |
| 125 | "predicted_depth_paths": self.get_predicted_depth_path(image_path), |
| 126 | } |
| 127 | return results |
| 128 | |
| 129 | class Predictor(torch.nn.Module): |
| 130 | def __init__(self, opt: Options, **model_kwargs): |
nothing calls this directly
no test coverage detected