rlawjdghek commited on
Commit
969087c
β€’
1 Parent(s): 2ec4f01

densepose add

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -21,7 +21,7 @@ from utils_stableviton import get_batch, get_mask_location, tensor2img
21
  PROJECT_ROOT = Path(__file__).absolute().parents[1].absolute()
22
  sys.path.insert(0, str(PROJECT_ROOT))
23
 
24
- # from detectron2.projects.DensePose.apply_net_gradio import DensePose4Gradio
25
  from preprocess.humanparsing.run_parsing import Parsing
26
  from preprocess.openpose.run_openpose import OpenPose
27
 
@@ -35,10 +35,10 @@ IMG_W = 384
35
  openpose_model_hd = OpenPose(0)
36
  openpose_model_hd.preprocessor.body_estimation.model.to('cuda')
37
  parsing_model_hd = Parsing(0)
38
- # densepose_model_hd = DensePose4Gradio(
39
- # cfg='preprocess/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x.yaml',
40
- # model='https://dl.fbaipublicfiles.com/densepose/densepose_rcnn_R_50_FPN_s1x/165712039/model_final_162be9.pkl',
41
- # )
42
 
43
  category_dict = ['upperbody', 'lowerbody', 'dress']
44
  category_dict_utils = ['upper_body', 'lower_body', 'dresses']
 
21
  PROJECT_ROOT = Path(__file__).absolute().parents[1].absolute()
22
  sys.path.insert(0, str(PROJECT_ROOT))
23
 
24
+ from detectron2.projects.DensePose.apply_net_gradio import DensePose4Gradio
25
  from preprocess.humanparsing.run_parsing import Parsing
26
  from preprocess.openpose.run_openpose import OpenPose
27
 
 
35
  openpose_model_hd = OpenPose(0)
36
  openpose_model_hd.preprocessor.body_estimation.model.to('cuda')
37
  parsing_model_hd = Parsing(0)
38
+ densepose_model_hd = DensePose4Gradio(
39
+ cfg='preprocess/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x.yaml',
40
+ model='https://dl.fbaipublicfiles.com/densepose/densepose_rcnn_R_50_FPN_s1x/165712039/model_final_162be9.pkl',
41
+ )
42
 
43
  category_dict = ['upperbody', 'lowerbody', 'dress']
44
  category_dict_utils = ['upper_body', 'lower_body', 'dresses']