Update app.py
Browse files
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 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
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')
|