jboth's picture
Upload pytorch3d_stub/pytorch3d/renderer/camera_utils.py with huggingface_hub
356b0e0 verified
raw
history blame contribute delete
432 Bytes
"""pytorch3d.renderer.camera_utils stub."""
import torch
def camera_to_eye_at_up(camera):
"""Extract eye, at, up from camera. Minimal stub."""
R = camera.R if hasattr(camera, "R") else torch.eye(3).unsqueeze(0)
T = camera.T if hasattr(camera, "T") else torch.zeros(1, 3)
eye = -torch.bmm(R, T.unsqueeze(-1)).squeeze(-1)
at = torch.zeros_like(eye)
up = torch.tensor([[0.0, 1.0, 0.0]])
return eye, at, up