MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / infer_mv_pointclouds

Function infer_mv_pointclouds

eval_code/recons/interfaces/pi3.py:152–168  ·  view source on GitHub ↗
(filelist: str, model: Pi3, hydra_cfg: DictConfig, data_size: Tuple[int, int])

Source from the content-addressed store, hash-verified

150 return poses_c2w_all[0], None
151
152def infer_mv_pointclouds(filelist: str, model: Pi3, hydra_cfg: DictConfig, data_size: Tuple[int, int]):
153
154 imgs = load_and_resize14(filelist, new_width=hydra_cfg.load_img_size, device=hydra_cfg.device, verbose=hydra_cfg.verbose)
155
156 dtype = torch.bfloat16 if torch.cuda.get_device_capability()[0] >= 8 else torch.float16
157
158 with torch.no_grad():
159 with torch.amp.autocast(hydra_cfg.device, dtype=dtype):
160 pred = model(imgs)
161
162 global_points = pred['points'][0] # (N, h, w, 3)
163 global_points = F.interpolate(
164 global_points.permute(0, 3, 1, 2), data_size,
165 mode="bilinear", align_corners=False, antialias=True
166 ).permute(0, 2, 3, 1) # align to gt
167
168 return global_points.cpu().numpy()

Callers 2

mainFunction · 0.50
mainFunction · 0.50

Calls 1

load_and_resize14Function · 0.70

Tested by

no test coverage detected