fffiloni commited on
Commit
2fcd834
·
1 Parent(s): 73f0891

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -9,6 +9,7 @@ except:
9
 
10
  import mmpose
11
  import gradio as gr
 
12
  from mmpose.apis import (inference_top_down_pose_model, init_pose_model,
13
  vis_pose_result, process_mmdet_results)
14
  from mmdet.apis import inference_detector, init_detector
@@ -26,6 +27,7 @@ pose_model = init_pose_model(pose_config, pose_checkpoint, device='cuda')
26
  # initialize detector
27
  det_model = init_detector(det_config, det_checkpoint, device='cuda')
28
 
 
29
  def predict(img):
30
  mmdet_results = inference_detector(det_model, img)
31
  person_results = process_mmdet_results(mmdet_results, cat_id=1)
 
9
 
10
  import mmpose
11
  import gradio as gr
12
+ import spaces
13
  from mmpose.apis import (inference_top_down_pose_model, init_pose_model,
14
  vis_pose_result, process_mmdet_results)
15
  from mmdet.apis import inference_detector, init_detector
 
27
  # initialize detector
28
  det_model = init_detector(det_config, det_checkpoint, device='cuda')
29
 
30
+ @spaces.GPU
31
  def predict(img):
32
  mmdet_results = inference_detector(det_model, img)
33
  person_results = process_mmdet_results(mmdet_results, cat_id=1)