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

Method process_scene

benchmark/methods/lingbot_map.py:258–293  ·  view source on GitHub ↗

Process a scene with LingbotMap inference.

(self, gt_artifact)

Source from the content-addressed store, hash-verified

256 return rgb_list, depth_list, pose_list, intrinsics_list, confidence_list
257
258 def process_scene(self, gt_artifact) -> Dict[str, Any]:
259 """Process a scene with LingbotMap inference."""
260 loader = BSSLoader(gt_artifact, resize_context=self.resize_context)
261 input_rgb_list = loader.load_rgb_list()
262 self.logger.info(f"Image size for processing: {loader.get_processing_dimensions()} (HxW)")
263
264 print(f" → Processing {len(input_rgb_list)} frames with LingbotMap (mode: {self.mode})")
265
266 # Prepare and run inference
267 images = self._prepare_images(input_rgb_list)
268 image_shape = images.shape[-2:] # (H, W)
269 predictions = self._run_inference(images)
270
271 # Convert outputs
272 rgb_list, depth_list, pose_list, intrinsics_list, confidence_list = \
273 self._process_outputs(predictions, image_shape)
274
275 if len(depth_list) != len(input_rgb_list):
276 print(f" → WARNING: Output frames ({len(depth_list)}) != input frames ({len(input_rgb_list)})")
277
278 # Assemble results
279 print(f" → Assembling {len(rgb_list)} frames in standard format")
280 frame_results = {
281 'rgb': rgb_list,
282 'depth': depth_list,
283 'pose': pose_list,
284 'intrinsics': intrinsics_list,
285 }
286
287 if confidence_list:
288 frame_results['confidence'] = confidence_list
289
290 return {
291 'frame': frame_results,
292 'global': {},
293 }

Callers

nothing calls this directly

Calls 6

load_rgb_listMethod · 0.95
_prepare_imagesMethod · 0.95
_run_inferenceMethod · 0.95
_process_outputsMethod · 0.95
BSSLoaderClass · 0.90

Tested by

no test coverage detected