fffiloni commited on
Commit
dd7e161
·
1 Parent(s): 7a4ce8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -9,9 +9,7 @@ mim.install('mmcv-full==1.5.0')
9
  import mmpose
10
  import gradio as gr
11
 
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
15
  from PIL import Image
16
  import cv2
17
  import numpy as np
@@ -23,10 +21,15 @@ det_checkpoint = 'faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth'
23
 
24
  @spaces.GPU
25
  def cache_features():
 
 
 
26
  init_pose_model(pose_config, pose_checkpoint, device='cuda')
27
  init_detector(det_config, det_checkpoint, device='cuda')
28
  cache_features()
29
-
 
 
30
  # initialize pose model
31
  pose_model = init_pose_model(pose_config, pose_checkpoint, device='cuda')
32
  # initialize detector
 
9
  import mmpose
10
  import gradio as gr
11
 
12
+
 
 
13
  from PIL import Image
14
  import cv2
15
  import numpy as np
 
21
 
22
  @spaces.GPU
23
  def cache_features():
24
+ from mmpose.apis import (inference_top_down_pose_model, init_pose_model,
25
+ vis_pose_result, process_mmdet_results)
26
+ from mmdet.apis import inference_detector, init_detector
27
  init_pose_model(pose_config, pose_checkpoint, device='cuda')
28
  init_detector(det_config, det_checkpoint, device='cuda')
29
  cache_features()
30
+ from mmpose.apis import (inference_top_down_pose_model, init_pose_model,
31
+ vis_pose_result, process_mmdet_results)
32
+ from mmdet.apis import inference_detector, init_detector
33
  # initialize pose model
34
  pose_model = init_pose_model(pose_config, pose_checkpoint, device='cuda')
35
  # initialize detector