MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / __getitem__

Method __getitem__

preprocess_depth_davis.py:106–127  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

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
129class Predictor(torch.nn.Module):
130 def __init__(self, opt: Options, **model_kwargs):

Callers

nothing calls this directly

Calls 3

resize_to_shorter_sideFunction · 0.85
resize_to_multiple_of_14Function · 0.85

Tested by

no test coverage detected