Spaces:
Running
on
Zero
Running
on
Zero
Update trellis/utils/render_utils.py
Browse files
trellis/utils/render_utils.py
CHANGED
@@ -88,12 +88,15 @@ 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 |
-
# Start with isometric view (
|
92 |
-
isometric_yaw_offset = 3.1415 / 4 #
|
93 |
yaws = torch.linspace(isometric_yaw_offset, 2 * 3.1415 + isometric_yaw_offset, num_frames)
|
94 |
-
|
|
|
|
|
|
|
|
|
95 |
yaws = yaws.tolist()
|
96 |
-
pitch = pitch.tolist()
|
97 |
extrinsics, intrinsics = yaw_pitch_r_fov_to_extrinsics_intrinsics(yaws, pitch, r, fov)
|
98 |
return render_frames(sample, extrinsics, intrinsics, {'resolution': resolution, 'bg_color': bg_color}, **kwargs)
|
99 |
|
|
|
88 |
|
89 |
|
90 |
def render_video(sample, resolution=512, bg_color=(0, 0, 0), num_frames=300, r=2, fov=40, **kwargs):
|
91 |
+
# Start with isometric view facing forward (225 degrees yaw for front-facing isometric)
|
92 |
+
isometric_yaw_offset = 5 * 3.1415 / 4 # 225 degrees in radians (front-facing isometric)
|
93 |
yaws = torch.linspace(isometric_yaw_offset, 2 * 3.1415 + isometric_yaw_offset, num_frames)
|
94 |
+
|
95 |
+
# Use a more consistent isometric pitch angle (around 35.26 degrees)
|
96 |
+
isometric_pitch = 0.615 # approximately 35.26 degrees in radians for true isometric
|
97 |
+
pitch = [isometric_pitch + 0.1 * torch.sin(2 * 3.1415 * i / num_frames) for i in range(num_frames)]
|
98 |
+
|
99 |
yaws = yaws.tolist()
|
|
|
100 |
extrinsics, intrinsics = yaw_pitch_r_fov_to_extrinsics_intrinsics(yaws, pitch, r, fov)
|
101 |
return render_frames(sample, extrinsics, intrinsics, {'resolution': resolution, 'bg_color': bg_color}, **kwargs)
|
102 |
|