caizhongang commited on
Commit
8998cf5
1 Parent(s): fdb9ee6

Support ZeroGPU

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -6,6 +6,7 @@ import cv2
6
  import gradio as gr
7
  import torch
8
  import math
 
9
 
10
  try:
11
  import mmpose
@@ -26,6 +27,7 @@ print(torch.cuda.get_device_name(index))
26
  from main.inference import Inferer
27
  inferer = Inferer(DEFAULT_MODEL, num_gpus, OUT_FOLDER)
28
 
 
29
  def infer(video_input, in_threshold=0.5, num_people="Single person", render_mesh=False):
30
  os.system(f'rm -rf {OUT_FOLDER}/*')
31
  multi_person = False if (num_people == "Single person") else True
 
6
  import gradio as gr
7
  import torch
8
  import math
9
+ import spaces
10
 
11
  try:
12
  import mmpose
 
27
  from main.inference import Inferer
28
  inferer = Inferer(DEFAULT_MODEL, num_gpus, OUT_FOLDER)
29
 
30
+ @spaces.GPU
31
  def infer(video_input, in_threshold=0.5, num_people="Single person", render_mesh=False):
32
  os.system(f'rm -rf {OUT_FOLDER}/*')
33
  multi_person = False if (num_people == "Single person") else True