MCPcopy Create free account
hub / github.com/TencentARC/InstantMesh / get_render_cameras

Function get_render_cameras

app.py:38–51  ·  view source on GitHub ↗

Get the rendering camera parameters.

(batch_size=1, M=120, radius=2.5, elevation=10.0, is_flexicubes=False)

Source from the content-addressed store, hash-verified

36os.makedirs(model_cache_dir, exist_ok=True)
37
38def get_render_cameras(batch_size=1, M=120, radius=2.5, elevation=10.0, is_flexicubes=False):
39 """
40 Get the rendering camera parameters.
41 """
42 c2ws = get_circular_camera_poses(M=M, radius=radius, elevation=elevation)
43 if is_flexicubes:
44 cameras = torch.linalg.inv(c2ws)
45 cameras = cameras.unsqueeze(0).repeat(batch_size, 1, 1, 1)
46 else:
47 extrinsics = c2ws.flatten(-2)
48 intrinsics = FOV_to_intrinsics(30.0).unsqueeze(0).repeat(M, 1, 1).float().flatten(-2)
49 cameras = torch.cat([extrinsics, intrinsics], dim=-1)
50 cameras = cameras.unsqueeze(0).repeat(batch_size, 1, 1)
51 return cameras
52
53
54def images_to_video(images, output_path, fps=30):

Callers 1

make3dFunction · 0.70

Calls 2

FOV_to_intrinsicsFunction · 0.90

Tested by

no test coverage detected