MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / inv

Function inv

eval_code/recons/models/pi3/utils/geometry.py:321–328  ·  view source on GitHub ↗

Invert a torch or numpy matrix

(mat)

Source from the content-addressed store, hash-verified

319
320
321def 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
330def opencv_camera_to_plucker(poses, K, H, W):
331 device = poses.device

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected