MCPcopy Create free account
hub / github.com/Ar-Ray-code/lingbot-depth-trt / ExportableLingBotDepth

Class ExportableLingBotDepth

tools/export_trt.py:185–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183
184
185class ExportableLingBotDepth(nn.Module):
186 def __init__(self, model: MDMModel, num_tokens: int):
187 super().__init__()
188 self.model = model
189 self.num_tokens = int(num_tokens)
190
191 def forward(self, image: torch.Tensor, depth: torch.Tensor) -> torch.Tensor:
192 output = self.model.forward(
193 image,
194 num_tokens=self.num_tokens,
195 depth=depth,
196 enable_depth_mask=False,
197 )
198 return output["depth_reg"]
199
200
201def load_capture(capture_dir: Path, device: torch.device) -> tuple[torch.Tensor, torch.Tensor, dict[str, Any]]:

Callers 1

load_export_modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected