fffiloni commited on
Commit
2a7b6f5
·
1 Parent(s): e63e95e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -18,6 +18,12 @@ pose_checkpoint = 'hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth'
18
  det_config = 'configs/faster_rcnn_r50_fpn_1x_coco.py'
19
  det_checkpoint = 'faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth'
20
 
 
 
 
 
 
 
21
  # initialize pose model
22
  pose_model = init_pose_model(pose_config, pose_checkpoint, device='cuda')
23
  # initialize detector
 
18
  det_config = 'configs/faster_rcnn_r50_fpn_1x_coco.py'
19
  det_checkpoint = 'faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth'
20
 
21
+ @spaces.GPU
22
+ def cache_features():
23
+ init_pose_model(pose_config, pose_checkpoint, device='cuda')
24
+ init_detector(det_config, det_checkpoint, device='cuda')
25
+ cache_features()
26
+
27
  # initialize pose model
28
  pose_model = init_pose_model(pose_config, pose_checkpoint, device='cuda')
29
  # initialize detector