Spaces:
Runtime error
Runtime error
kleinhe
commited on
Commit
Β·
479b355
1
Parent(s):
50a02f4
speed
Browse files
app.py
CHANGED
@@ -9,10 +9,10 @@ css = """
|
|
9 |
|
10 |
from huggingface_hub import snapshot_download
|
11 |
from motion.visual_api import Visualize
|
12 |
-
import cv2
|
13 |
import torch
|
14 |
import json
|
15 |
from tqdm import tqdm
|
|
|
16 |
|
17 |
with open("motion/path.json", "r") as f:
|
18 |
json_dict = json.load(f)
|
@@ -73,12 +73,7 @@ def demo(prompt, mode, condition, render_mode="joints", skip_steps=0, out_size=1
|
|
73 |
meshes, _ = visual.get_mesh(output)
|
74 |
pics = visual.pyrender_process(meshes, out_size, out_size)
|
75 |
|
76 |
-
|
77 |
-
for pic in tqdm(pics):
|
78 |
-
pic = pic[:, :, :3]
|
79 |
-
pic = cv2.cvtColor(pic, cv2.COLOR_BGR2RGB)
|
80 |
-
video.write(pic) #εε
₯θ§ι’
|
81 |
-
video.release()
|
82 |
|
83 |
if mode[i] == "cadm":
|
84 |
out_paths[0] = video_path
|
@@ -111,9 +106,9 @@ def t2m_demo():
|
|
111 |
|
112 |
with gr.Blocks(analytics_enabled=False, css=css) as t2m_interface:
|
113 |
gr.Markdown("<div align='center'> <h2> π€·ββοΈ SemanticBoost: Elevating Motion Generation with Augmented Textual Cues </span> </h2> \
|
114 |
-
<a style='font-size:18px;
|
115 |
-
<a style='font-size:18px;
|
116 |
-
<a style='font-size:18px;
|
117 |
|
118 |
with gr.Row().style(equal_height=True):
|
119 |
with gr.Column(variant='panel'):
|
@@ -142,21 +137,21 @@ def t2m_demo():
|
|
142 |
with gr.TabItem('Results'):
|
143 |
with gr.Row():
|
144 |
with gr.Column():
|
145 |
-
gen_video = gr.
|
146 |
with gr.Column():
|
147 |
joint_file = gr.File(label="CADM-Joints", value=None, elem_classes="dfile")
|
148 |
smpl_file = gr.File(label="CADM-SMPL", value=None, elem_classes="dfile")
|
149 |
|
150 |
with gr.Row():
|
151 |
with gr.Column():
|
152 |
-
gen_video1 = gr.
|
153 |
with gr.Column():
|
154 |
joint_file1 = gr.File(label="CADM-Augment-Joints", value=None, elem_classes="dfile")
|
155 |
smpl_file1 = gr.File(label="CADM-Augment-SMPL", value=None, elem_classes="dfile")
|
156 |
|
157 |
with gr.Row():
|
158 |
with gr.Column():
|
159 |
-
gen_video2 = gr.
|
160 |
with gr.Column():
|
161 |
joint_file2 = gr.File(label="MDM-Joints", value=None, elem_classes="dfile")
|
162 |
smpl_file2 = gr.File(label="MDM-SMPL", value=None, elem_classes="dfile")
|
|
|
9 |
|
10 |
from huggingface_hub import snapshot_download
|
11 |
from motion.visual_api import Visualize
|
|
|
12 |
import torch
|
13 |
import json
|
14 |
from tqdm import tqdm
|
15 |
+
import imageio
|
16 |
|
17 |
with open("motion/path.json", "r") as f:
|
18 |
json_dict = json.load(f)
|
|
|
73 |
meshes, _ = visual.get_mesh(output)
|
74 |
pics = visual.pyrender_process(meshes, out_size, out_size)
|
75 |
|
76 |
+
imageio.mimsave(video_path, pics, duration= 1000 / 20, loop=0)
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
if mode[i] == "cadm":
|
79 |
out_paths[0] = video_path
|
|
|
106 |
|
107 |
with gr.Blocks(analytics_enabled=False, css=css) as t2m_interface:
|
108 |
gr.Markdown("<div align='center'> <h2> π€·ββοΈ SemanticBoost: Elevating Motion Generation with Augmented Textual Cues </span> </h2> \
|
109 |
+
<a style='font-size:18px;' href=''>Arxiv</a> \
|
110 |
+
<a style='font-size:18px;' href='https://blackgold3.github.io/SemanticBoost/'>Homepage</a> \
|
111 |
+
<a style='font-size:18px;' href='https://github.com/blackgold3/SemanticBoost'> Github </div>")
|
112 |
|
113 |
with gr.Row().style(equal_height=True):
|
114 |
with gr.Column(variant='panel'):
|
|
|
137 |
with gr.TabItem('Results'):
|
138 |
with gr.Row():
|
139 |
with gr.Column():
|
140 |
+
gen_video = gr.Image(label="CADM", elem_classes="ov")
|
141 |
with gr.Column():
|
142 |
joint_file = gr.File(label="CADM-Joints", value=None, elem_classes="dfile")
|
143 |
smpl_file = gr.File(label="CADM-SMPL", value=None, elem_classes="dfile")
|
144 |
|
145 |
with gr.Row():
|
146 |
with gr.Column():
|
147 |
+
gen_video1 = gr.Image(label="CADM-Augment", elem_classes="ov")
|
148 |
with gr.Column():
|
149 |
joint_file1 = gr.File(label="CADM-Augment-Joints", value=None, elem_classes="dfile")
|
150 |
smpl_file1 = gr.File(label="CADM-Augment-SMPL", value=None, elem_classes="dfile")
|
151 |
|
152 |
with gr.Row():
|
153 |
with gr.Column():
|
154 |
+
gen_video2 = gr.Image(label="MDM", elem_classes="ov")
|
155 |
with gr.Column():
|
156 |
joint_file2 = gr.File(label="MDM-Joints", value=None, elem_classes="dfile")
|
157 |
smpl_file2 = gr.File(label="MDM-SMPL", value=None, elem_classes="dfile")
|