MCPcopy Create free account
hub / github.com/apple/ml-pointersect / _set_grid

Method _set_grid

pointersect/inference/structures.py:3986–4011  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3984 self.cam_poses.append(poses)
3985
3986 def _set_grid(self):
3987 # build camera grid around one point
3988 # currently only used in one case in inverse rendering
3989
3990 assert 'min_r' in self.params
3991 assert 'max_r' in self.params
3992 max_r = self.params['max_r']
3993 min_r = self.params['min_r']
3994
3995 grid_width = int(np.ceil(np.sqrt(self.n_imgs)))
3996 total_imgs = grid_width * grid_width
3997
3998 self.cam_poses = []
3999 for i in range(self.total):
4000 poses = []
4001
4002 Hs_c2w = utils.generate_camera_grids(
4003 num_x=grid_width,
4004 num_y=grid_width,
4005 cam_position_center=np.array([-max_r, 0, 0]),
4006 ) # (n, 4, 4)
4007
4008 for j in np.random.permutation(total_imgs)[range(self.n_imgs)]:
4009 poses.append(Hs_c2w[j])
4010
4011 self.cam_poses.append(poses)
4012
4013 def _set_polar_grid(self):
4014 # both input and target are around the same circle path

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected