kiwhansong commited on
Commit
e2447ec
·
1 Parent(s): 323560e

fix all durations

Browse files
Files changed (1) hide show
  1. app.py +15 -4
app.py CHANGED
@@ -94,7 +94,11 @@ def video_to_gif_and_images(video, indices):
94
  ]
95
 
96
 
97
- @spaces.GPU(duration=200)
 
 
 
 
98
  @torch.autocast("cuda")
99
  @torch.no_grad()
100
  def single_image_to_long_video(
@@ -117,7 +121,7 @@ def single_image_to_long_video(
117
  return export_to_video(gen_video[0].detach().cpu(), fps=fps)
118
 
119
 
120
- @spaces.GPU()
121
  @torch.autocast("cuda")
122
  @torch.no_grad()
123
  def any_images_to_short_video(
@@ -172,7 +176,7 @@ class CustomProgressBar:
172
  return getattr(self.pbar, attr)
173
 
174
 
175
- @spaces.GPU()
176
  @torch.autocast("cuda")
177
  @torch.no_grad()
178
  def navigate_video(
@@ -360,7 +364,14 @@ def _interpolate_between(
360
  return xs, long_conditions
361
 
362
 
363
- @spaces.GPU(duration=200)
 
 
 
 
 
 
 
364
  @torch.autocast("cuda")
365
  @torch.no_grad()
366
  def smooth_navigation(
 
94
  ]
95
 
96
 
97
+ def get_duration_single_image_to_long_video(idx: int, guidance_scale: float, fps: int):
98
+ return 30 * fps
99
+
100
+
101
+ @spaces.GPU(duration=get_duration_single_image_to_long_video)
102
  @torch.autocast("cuda")
103
  @torch.no_grad()
104
  def single_image_to_long_video(
 
121
  return export_to_video(gen_video[0].detach().cpu(), fps=fps)
122
 
123
 
124
+ @spaces.GPU(duration=45)
125
  @torch.autocast("cuda")
126
  @torch.no_grad()
127
  def any_images_to_short_video(
 
176
  return getattr(self.pbar, attr)
177
 
178
 
179
+ @spaces.GPU(duration=45)
180
  @torch.autocast("cuda")
181
  @torch.no_grad()
182
  def navigate_video(
 
364
  return xs, long_conditions
365
 
366
 
367
+ def get_duration_smooth_navigation(
368
+ video: torch.Tensor, poses: torch.Tensor, interpolation_factor: int
369
+ ):
370
+ length = (len(video) - 1) * interpolation_factor + 1
371
+ return 2 * length
372
+
373
+
374
+ @spaces.GPU(duration=get_duration_smooth_navigation)
375
  @torch.autocast("cuda")
376
  @torch.no_grad()
377
  def smooth_navigation(