myniu commited on
Commit
b4d6fd1
1 Parent(s): b0779c3
Files changed (2) hide show
  1. app.py +3 -3
  2. models/cmp/utils/common_utils.py +0 -1
app.py CHANGED
@@ -89,7 +89,7 @@ def get_sparseflow_and_mask_forward(
89
  return s_flow, mask
90
 
91
 
92
- @spaces.GPU(duration=300)
93
  def init_models(pretrained_model_name_or_path, resume_from_checkpoint, weight_dtype, device='cuda', enable_xformers_memory_efficient_attention=False, allow_tf32=False):
94
 
95
  from models.unet_spatio_temporal_condition_controlnet import UNetSpatioTemporalConditionControlNetModel
@@ -216,7 +216,7 @@ def visualize_drag_v2(background_image_path, splited_tracks, width, height):
216
 
217
 
218
  class Drag:
219
- @spaces.GPU(duration=300)
220
  def __init__(self, device, height, width, model_length):
221
  self.device = device
222
 
@@ -488,7 +488,7 @@ class Drag:
488
 
489
  return viz_esti_flows
490
 
491
- @spaces.GPU(duration=500)
492
  def run(self, first_frame_path, tracking_points, inference_batch_size, motion_brush_mask, motion_brush_viz, ctrl_scale):
493
 
494
  original_width, original_height = self.width, self.height
 
89
  return s_flow, mask
90
 
91
 
92
+ @spaces.GPU(duration=200)
93
  def init_models(pretrained_model_name_or_path, resume_from_checkpoint, weight_dtype, device='cuda', enable_xformers_memory_efficient_attention=False, allow_tf32=False):
94
 
95
  from models.unet_spatio_temporal_condition_controlnet import UNetSpatioTemporalConditionControlNetModel
 
216
 
217
 
218
  class Drag:
219
+ @spaces.GPU(duration=200)
220
  def __init__(self, device, height, width, model_length):
221
  self.device = device
222
 
 
488
 
489
  return viz_esti_flows
490
 
491
+ @spaces.GPU(duration=200)
492
  def run(self, first_frame_path, tracking_points, inference_batch_size, motion_brush_mask, motion_brush_viz, ctrl_scale):
493
 
494
  original_width, original_height = self.width, self.height
models/cmp/utils/common_utils.py CHANGED
@@ -94,7 +94,6 @@ def accuracy(output, target, topk=(1,)):
94
  return res
95
 
96
 
97
- @spaces.GPU(duration=300)
98
  def load_state(path, model, optimizer=None):
99
  def map_func(storage, location):
100
  return storage.cuda()
 
94
  return res
95
 
96
 
 
97
  def load_state(path, model, optimizer=None):
98
  def map_func(storage, location):
99
  return storage.cuda()