MCPcopy Index your code
hub / github.com/ActiveVisionLab/DFNet / fix_coord_supp

Function fix_coord_supp

script/dm/direct_pose_model.py:147–167  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

145 return batch_rays, target_s
146
147def 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
169def eval_on_batch(args, data, model, pose, img_idx, hwf, half_res, device, **render_kwargs_test):
170 ''' Perform 1 step of eval'''

Callers 8

render_nerfw_imgsFunction · 0.90
render_virtual_imgsFunction · 0.90
eval_on_batchFunction · 0.90
train_on_feature_batchFunction · 0.90
train_on_batchFunction · 0.90
eval_on_batchFunction · 0.85
train_on_batchFunction · 0.85
save_val_result_7ScenesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected