MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / forward

Method forward

ldm/modules/midas/api.py:157–169  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

155 self.model.train = disabled_train
156
157 def forward(self, x):
158 # x in 0..1 as produced by calling self.transform on a 0..1 float64 numpy array
159 # NOTE: we expect that the correct transform has been called during dataloading.
160 with torch.no_grad():
161 prediction = self.model(x)
162 prediction = torch.nn.functional.interpolate(
163 prediction.unsqueeze(1),
164 size=x.shape[2:],
165 mode="bicubic",
166 align_corners=False,
167 )
168 assert prediction.shape == (x.shape[0], 1, x.shape[2], x.shape[3])
169 return prediction
170

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected