Copied from https://github.com/hehao13/CameraCtrl/blob/main/inference.py
(*args)
| 216 | self.c2w_mat = np.linalg.inv(w2c_mat_4x4) |
| 217 | |
| 218 | def custom_meshgrid(*args): |
| 219 | """Copied from https://github.com/hehao13/CameraCtrl/blob/main/inference.py |
| 220 | """ |
| 221 | # ref: https://pytorch.org/docs/stable/generated/torch.meshgrid.html?highlight=meshgrid#torch.meshgrid |
| 222 | if pver.parse(torch.__version__) < pver.parse('1.10'): |
| 223 | return torch.meshgrid(*args) |
| 224 | else: |
| 225 | return torch.meshgrid(*args, indexing='ij') |
| 226 | |
| 227 | def get_relative_pose(cam_params): |
| 228 | """Copied from https://github.com/hehao13/CameraCtrl/blob/main/inference.py |