Spaces:
Running
on
Zero
Running
on
Zero
Update trellis/utils/render_utils.py
Browse files
trellis/utils/render_utils.py
CHANGED
@@ -88,12 +88,12 @@ 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
|
92 |
-
|
93 |
-
yaws = torch.linspace(
|
94 |
-
pitch = [0.
|
95 |
yaws = yaws.tolist()
|
96 |
-
|
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 at 45 degrees from front and rotate from there
|
92 |
+
start_angle = 3.1415 / 4 # 45 degrees in radians
|
93 |
+
yaws = torch.linspace(start_angle, 2 * 3.1415 + start_angle, num_frames) # Full rotation starting from 45 degrees
|
94 |
+
pitch = torch.tensor([0.4] * num_frames) # Fixed pitch for isometric-like view (slightly above)
|
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 |
|