arabago96 commited on
Commit
cea51c4
·
verified ·
1 Parent(s): c0c624d

Update trellis/utils/render_utils.py

Browse files
Files changed (1) hide show
  1. trellis/utils/render_utils.py +5 -5
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 with isometric view (45 degrees yaw offset)
92
- isometric_yaw_offset = 3.1415 / 4 # 45 degrees in radians
93
- yaws = torch.linspace(isometric_yaw_offset, 2 * 3.1415 + isometric_yaw_offset, num_frames)
94
- pitch = [0.25] * num_frames # Fixed pitch for isometric view
95
  yaws = yaws.tolist()
96
- # pitch is already a list, no .tolist() needed
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