joselobenitezg commited on
Commit
e801a99
·
verified ·
1 Parent(s): 7c6db95

add spaces.gpu

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -15,6 +15,7 @@ def update_model_choices(task):
15
  model_choices = list(SAPIENS_LITE_MODELS_PATH[task.lower()].keys())
16
  return gr.Dropdown(choices=model_choices, value=model_choices[0] if model_choices else None)
17
 
 
18
  def process_image(input_image, task, version):
19
  if isinstance(input_image, np.ndarray):
20
  input_image = Image.fromarray(input_image)
@@ -33,6 +34,7 @@ def process_image(input_image, task, version):
33
 
34
  return result
35
 
 
36
  def process_video(input_video, task, version):
37
  cap = cv2.VideoCapture(input_video)
38
  fps = cap.get(cv2.CAP_PROP_FPS)
 
15
  model_choices = list(SAPIENS_LITE_MODELS_PATH[task.lower()].keys())
16
  return gr.Dropdown(choices=model_choices, value=model_choices[0] if model_choices else None)
17
 
18
+ @spaces.gpu
19
  def process_image(input_image, task, version):
20
  if isinstance(input_image, np.ndarray):
21
  input_image = Image.fromarray(input_image)
 
34
 
35
  return result
36
 
37
+ @spaces.gpu
38
  def process_video(input_video, task, version):
39
  cap = cv2.VideoCapture(input_video)
40
  fps = cap.get(cv2.CAP_PROP_FPS)