Invert a torch or numpy matrix
(mat)
| 319 | |
| 320 | |
| 321 | def inv(mat): |
| 322 | """ Invert a torch or numpy matrix |
| 323 | """ |
| 324 | if isinstance(mat, torch.Tensor): |
| 325 | return torch.linalg.inv(mat) |
| 326 | if isinstance(mat, np.ndarray): |
| 327 | return np.linalg.inv(mat) |
| 328 | raise ValueError(f'bad matrix type = {type(mat)}') |
| 329 | |
| 330 | def opencv_camera_to_plucker(poses, K, H, W): |
| 331 | device = poses.device |
nothing calls this directly
no outgoing calls
no test coverage detected