supplementary fix_coord() for direct matching Inputs: args: parsed argument pose: pose [N, 3, 4] device: cpu or gpu Outputs: pose: converted Pose in shape [N, 3, 4]
(args, pose, world_setup_dict, device=None)
| 145 | return batch_rays, target_s |
| 146 | |
| 147 | def fix_coord_supp(args, pose, world_setup_dict, device=None): |
| 148 | # this function needs to be fixed because it is taking args.pose_scale |
| 149 | '''supplementary fix_coord() for direct matching |
| 150 | Inputs: |
| 151 | args: parsed argument |
| 152 | pose: pose [N, 3, 4] |
| 153 | device: cpu or gpu |
| 154 | Outputs: |
| 155 | pose: converted Pose in shape [N, 3, 4] |
| 156 | ''' |
| 157 | sc=world_setup_dict['pose_scale'] # manual tuned factor, align with colmap scale |
| 158 | if device is None: |
| 159 | move_all_cam_vec = torch.Tensor(world_setup_dict['move_all_cam_vec']) |
| 160 | else: |
| 161 | move_all_cam_vec = torch.Tensor(world_setup_dict['move_all_cam_vec']).to(device) |
| 162 | sc2 = world_setup_dict['pose_scale2'] |
| 163 | pose[:,:3,3] *= sc |
| 164 | # move center of camera pose |
| 165 | pose[:, :3, 3] += move_all_cam_vec |
| 166 | pose[:,:3,3] *= sc2 |
| 167 | return pose |
| 168 | |
| 169 | def eval_on_batch(args, data, model, pose, img_idx, hwf, half_res, device, **render_kwargs_test): |
| 170 | ''' Perform 1 step of eval''' |
no outgoing calls
no test coverage detected