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

Method _set_rex_in

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

Source from the content-addressed store, hash-verified

3907 self.cam_poses.append(poses)
3908
3909 def _set_rex_in(self):
3910 # assumption:
3911 # input is from 14 input cameras.
3912 # mesh size (-4, 4)
3913 assert 'max_r' in self.params
3914 max_r = self.params['max_r']
3915
3916 self.cam_poses = []
3917 for i in range(self.total):
3918 # r = max_r
3919 poses = []
3920 target_poses_neighbors = []
3921
3922 # sample input from grid points on polar axis
3923 # details are in self.cam_path_mode == 'polar_grid':
3924
3925 num_phi = int(np.ceil((np.sqrt(2 * self.n_imgs - 3) + 3.) / 2.))
3926 num_theta = 2 * (num_phi - 1)
3927 total_imgs = num_theta * (num_phi - 2) + 2
3928
3929 Hs_c2w, neighbor_ids = utils.generate_camera_polar_grids(
3930 num_phi=num_phi,
3931 num_theta=num_theta,
3932 r=max_r
3933 ) # (n, 4, 4)
3934
3935 for j in range(self.n_imgs):
3936 poses.append(Hs_c2w[j])
3937
3938 self.cam_poses.append(poses)
3939
3940 def _set_rect(self):
3941 assert self.total == 1

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected