Spaces:
Running
on
Zero
Running
on
Zero
Update trellis/utils/render_utils.py
Browse files
trellis/utils/render_utils.py
CHANGED
@@ -88,13 +88,8 @@ def render_frames(sample, extrinsics, intrinsics, options={}, colors_overwrite=N
|
|
88 |
|
89 |
|
90 |
def render_video(sample, resolution=512, bg_color=(0, 0, 0), num_frames=300, r=2, fov=40, **kwargs):
|
91 |
-
|
92 |
-
|
93 |
-
front_isometric_offset = 3.246 # radians, approximately 186 degrees
|
94 |
-
|
95 |
-
# Apply the same offset to both yaw and pitch wave to maintain the exact camera position
|
96 |
-
yaws = torch.linspace(front_isometric_offset, 2 * 3.1415 + front_isometric_offset, num_frames)
|
97 |
-
pitch = 0.25 + 0.5 * torch.sin(torch.linspace(front_isometric_offset, 2 * 3.1415 + front_isometric_offset, num_frames))
|
98 |
yaws = yaws.tolist()
|
99 |
pitch = pitch.tolist()
|
100 |
extrinsics, intrinsics = yaw_pitch_r_fov_to_extrinsics_intrinsics(yaws, pitch, r, fov)
|
|
|
88 |
|
89 |
|
90 |
def render_video(sample, resolution=512, bg_color=(0, 0, 0), num_frames=300, r=2, fov=40, **kwargs):
|
91 |
+
yaws = torch.linspace(0, 2 * 3.1415, num_frames)
|
92 |
+
pitch = 0.25 + 0.5 * torch.sin(torch.linspace(0, 2 * 3.1415, num_frames))
|
|
|
|
|
|
|
|
|
|
|
93 |
yaws = yaws.tolist()
|
94 |
pitch = pitch.tolist()
|
95 |
extrinsics, intrinsics = yaw_pitch_r_fov_to_extrinsics_intrinsics(yaws, pitch, r, fov)
|