MCPcopy Create free account
hub / github.com/Robbyant/lingbot-map / _prepare_images

Method _prepare_images

benchmark/methods/lingbot_map.py:141–147  ·  view source on GitHub ↗

Convert list of HxWx3 uint8 numpy arrays to [S, 3, H, W] tensor in [0, 1].

(self, rgb_list)

Source from the content-addressed store, hash-verified

139 self.model = self.model.to(self.device).eval()
140
141 def _prepare_images(self, rgb_list):
142 """Convert list of HxWx3 uint8 numpy arrays to [S, 3, H, W] tensor in [0, 1]."""
143 from torchvision import transforms as TF
144
145 to_tensor = TF.ToTensor()
146 images = torch.stack([to_tensor(rgb) for rgb in rgb_list])
147 return images.to(self.device)
148
149 def _run_inference(self, images):
150 """Run LingbotMap inference and return raw predictions dict."""

Callers 1

process_sceneMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected