wzhouxiff commited on
Commit
2a2a6d8
1 Parent(s): 25b246b
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import os
2
  import gradio as gr
3
 
 
1
+ import spaces
2
  import os
3
  import gradio as gr
4
 
objctrl_2_5d/objctrl_2_5d.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import os
2
  import torch
3
  import numpy as np
@@ -39,6 +41,7 @@ down_scale = 8
39
  H, W = height // down_scale, width // down_scale
40
  K = np.array([[width / down_scale, 0, W / 2], [0, width / down_scale, H / 2], [0, 0, 1]])
41
 
 
42
  def run(pipeline, device):
43
  def run_objctrl_2_5d(condition_image,
44
  mask,
 
1
+ import spaces
2
+
3
  import os
4
  import torch
5
  import numpy as np
 
41
  H, W = height // down_scale, width // down_scale
42
  K = np.array([[width / down_scale, 0, W / 2], [0, width / down_scale, H / 2], [0, 0, 1]])
43
 
44
+ @spaces.GPU(duration=50)
45
  def run(pipeline, device):
46
  def run_objctrl_2_5d(condition_image,
47
  mask,
objctrl_2_5d/utils/ui_utils.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import gradio as gr
2
  from PIL import Image
3
  import numpy as np
@@ -50,6 +52,7 @@ def process_image(raw_image):
50
  def get_subject_points(canvas):
51
  return canvas["image"], canvas["points"]
52
 
 
53
  def run_segment(segmentor):
54
  def segment(canvas, image, logits):
55
  if logits is not None:
@@ -142,6 +145,7 @@ def get_points(img,
142
  def undo_points(original_image):
143
  return original_image, []
144
 
 
145
  def run_depth(d_model_NK):
146
  def get_depth(image, points):
147
 
 
1
+ import spaces
2
+
3
  import gradio as gr
4
  from PIL import Image
5
  import numpy as np
 
52
  def get_subject_points(canvas):
53
  return canvas["image"], canvas["points"]
54
 
55
+ @spaces.GPU(duration=50)
56
  def run_segment(segmentor):
57
  def segment(canvas, image, logits):
58
  if logits is not None:
 
145
  def undo_points(original_image):
146
  return original_image, []
147
 
148
+ @spaces.GPU(duration=50)
149
  def run_depth(d_model_NK):
150
  def get_depth(image, points):
151