Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About get_camera_trans in model.py #32

Open
lllll8 opened this issue Oct 24, 2023 · 2 comments
Open

About get_camera_trans in model.py #32

lllll8 opened this issue Oct 24, 2023 · 2 comments

Comments

@lllll8
Copy link

lllll8 commented Oct 24, 2023

def get_camera_trans(self, cam_param, meta_info, is_render): # camera translation t_xy = cam_param[:,:2] gamma = torch.sigmoid(cam_param[:,2]) # apply sigmoid to make it positive k_value = torch.FloatTensor([math.sqrt(cfg.focal[0]*cfg.focal[1]*cfg.camera_3d_size*cfg.camera_3d_size/(cfg.input_img_shape[0]*cfg.input_img_shape[1]))]).cuda().view(-1) if is_render: bbox = meta_info['bbox'] k_value = k_value * math.sqrt(cfg.input_img_shape[0]*cfg.input_img_shape[1]) / (bbox[:, 2]*bbox[:, 3]).sqrt() t_z = k_value * gamma cam_trans = torch.cat((t_xy, t_z[:,None]),1) return cam_trans

Hi, how to understand this function about the parameters including cam_param, gamma, k_value,t_z, cam_trans?

@hongsukchoi
Copy link
Owner

Hi,
cam_param[:, :2] is the xy translation of the mesh in the camera coordinate, k_value is the absolute distance of the mesh from the camera using the perspective camera, cam_param[:, 2] is the learned correction factor that could improve the accuracy of k_value, t_z is the final absolute distance from the camera, and cam_trans is the xyz translation of the mesh in the camera coordinate.

For the theoritical background, please refer to this paper: https://arxiv.org/abs/1907.11346

@lllll8
Copy link
Author

lllll8 commented Oct 25, 2023

Thanks for your to spend time responsing above question, you do great work!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants