fantaxy commited on
Commit
ddc9ba1
1 Parent(s): dd53d2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -35
app.py CHANGED
@@ -6,7 +6,6 @@ from musepose_inference import MusePoseInference
6
  from pose_align import PoseAlignmentInference
7
  from downloading_weights import download_models
8
 
9
-
10
  class App:
11
  def __init__(self, args):
12
  self.args = args
@@ -26,39 +25,32 @@ class App:
26
  return [gr.Image(label="Input Image", value=input_img, type="filepath", scale=5),
27
  gr.Video(label="Input Aligned Pose Video", value=input_pose_vid, scale=5)]
28
 
29
- def musepose_demo(self):
30
- with gr.Blocks() as demo:
31
- md_header = self.header()
32
- with gr.Tabs():
33
- with gr.TabItem('1: Pose Alignment'):
34
- with gr.Row():
35
- with gr.Column(scale=3):
36
- img_pose_input = gr.Image(label="Input Image", type="filepath", scale=5)
37
- vid_dance_input = gr.Video(label="Input Dance Video", max_length=10, scale=5) # Changed max_length to 10
38
- with gr.Column(scale=3):
39
- vid_dance_output = gr.Video(label="Aligned Pose Output", scale=5, interactive=False)
40
- vid_dance_output_demo = gr.Video(label="Aligned Pose Output Demo", scale=5)
41
- # Rest of the column setup remains the same
42
- with gr.Column(scale=3):
43
- # Column settings remain the same
44
-
45
- # Button settings and event handlers remain the same
46
-
47
- with gr.TabItem('2: MusePose Inference'):
48
- with gr.Row():
49
- with gr.Column(scale=3):
50
- img_musepose_input = gr.Image(label="Input Image", type="filepath", scale=5)
51
- vid_pose_input = gr.Video(label="Input Aligned Pose Video", max_length=10, scale=5) # Changed max_length to 10
52
- with gr.Column(scale=3):
53
- vid_output = gr.Video(label="MusePose Output", scale=5)
54
- vid_output_demo = gr.Video(label="MusePose Output Demo", scale=5)
55
-
56
- # Rest of the settings remains the same
57
-
58
- # Event handler and button settings remain unchanged
59
-
60
- return demo
61
-
62
 
63
  @staticmethod
64
  def header():
@@ -82,7 +74,6 @@ def musepose_demo(self):
82
  share=self.args.share
83
  )
84
 
85
-
86
  if __name__ == "__main__":
87
  parser = argparse.ArgumentParser()
88
  parser.add_argument('--model_dir', type=str, default=os.path.join("pretrained_weights"), help='Pretrained models directory for MusePose')
 
6
  from pose_align import PoseAlignmentInference
7
  from downloading_weights import download_models
8
 
 
9
  class App:
10
  def __init__(self, args):
11
  self.args = args
 
25
  return [gr.Image(label="Input Image", value=input_img, type="filepath", scale=5),
26
  gr.Video(label="Input Aligned Pose Video", value=input_pose_vid, scale=5)]
27
 
28
+ def musepose_demo(self):
29
+ with gr.Blocks() as demo:
30
+ md_header = self.header()
31
+ with gr.Tabs():
32
+ with gr.TabItem('1: Pose Alignment'):
33
+ with gr.Row():
34
+ with gr.Column(scale=3):
35
+ img_pose_input = gr.Image(label="Input Image", type="filepath", scale=5)
36
+ vid_dance_input = gr.Video(label="Input Dance Video", max_length=10, scale=5)
37
+ with gr.Column(scale=3):
38
+ vid_dance_output = gr.Video(label="Aligned Pose Output", scale=5, interactive=False)
39
+ vid_dance_output_demo = gr.Video(label="Aligned Pose Output Demo", scale=5)
40
+ # Rest of the column setup remains the same
41
+ with gr.Column(scale=3):
42
+ # Column settings remain the same
43
+
44
+ with gr.TabItem('2: MusePose Inference'):
45
+ with gr.Row():
46
+ with gr.Column(scale=3):
47
+ img_musepose_input = gr.Image(label="Input Image", type="filepath", scale=5)
48
+ vid_pose_input = gr.Video(label="Input Aligned Pose Video", max_length=10, scale=5)
49
+ with gr.Column(scale=3):
50
+ vid_output = gr.Video(label="MusePose Output", scale=5)
51
+ vid_output_demo = gr.Video(label="MusePose Output Demo", scale=5)
52
+ # Rest of the settings remains the same
53
+ return demo
 
 
 
 
 
 
 
54
 
55
  @staticmethod
56
  def header():
 
74
  share=self.args.share
75
  )
76
 
 
77
  if __name__ == "__main__":
78
  parser = argparse.ArgumentParser()
79
  parser.add_argument('--model_dir', type=str, default=os.path.join("pretrained_weights"), help='Pretrained models directory for MusePose')