Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -85,8 +85,8 @@ HEAD = ("""<div>
|
|
85 |
<h1>MotionCLR: Motion Generation and Training-free Editing via Understanding Attention Mechanisms</h1>
|
86 |
<h3>
|
87 |
<a href="https://lhchen.top" target="_blank" rel="noopener noreferrer">Ling-Hao Chen</a><sup>1, 2</sup>,
|
88 |
-
<a href="https://
|
89 |
-
<a href="https://
|
90 |
<a href="https://shunlinlu.github.io" target="_blank" rel="noopener noreferrer">Shunlin Lu</a><sup>4</sup>,
|
91 |
<a href="https://leizhang.org" target="_blank" rel="noopener noreferrer">Lei Zhang</a><sup>🤗 2</sup>
|
92 |
</h3>
|
@@ -195,7 +195,7 @@ def generate_video_from_text(text, opt, pipeline):
|
|
195 |
exc = end_time - start_time
|
196 |
gr.Info(f"Rendering time cost: {exc:.2f} s", duration = 3)
|
197 |
|
198 |
-
video_dis = f'<video controls playsinline width="{width}" style="display: block; margin: 0 auto;" src="
|
199 |
style_dis = video_dis + """<br> <p align="center"> Content Reference </p>"""
|
200 |
global edit_config
|
201 |
edit_config = set_all_use_to_false(edit_config)
|
@@ -274,7 +274,7 @@ def reweighting(text, idx, weight, opt, pipeline):
|
|
274 |
exc = end_time - start_time
|
275 |
gr.Info(f"Rendering time cost: {exc:.2f} s", duration = 3)
|
276 |
|
277 |
-
video_dis = f'<video controls playsinline width="{width}" style="display: block; margin: 0 auto;" src="
|
278 |
|
279 |
|
280 |
edit_config = set_all_use_to_false(edit_config)
|
@@ -352,7 +352,7 @@ def generate_example_based_motion(text, chunk_size, example_based_steps_end, tem
|
|
352 |
kinematic_tree = paramUtil.t2m_kinematic_chain if (opt.dataset_name == 't2m') else paramUtil.kit_kinematic_chain
|
353 |
plot_3d_motion(save_paths[i], kinematic_tree, motion, title=title, fps=opt.fps, radius=opt.radius)
|
354 |
video_html = f'''
|
355 |
-
<video class="retrieved_video" width="{width}" height="{height}" preload="auto" muted playsinline onpause="this.load()" autoplay loop disablepictureinpicture src="
|
356 |
'''
|
357 |
video_dis.append(video_html)
|
358 |
i += 1
|
@@ -436,9 +436,9 @@ def transfer_style(text, style_text, style_transfer_steps_end, opt, pipeline):
|
|
436 |
exc = end_time - start_time
|
437 |
gr.Info(f"Rendering time cost: {exc:.2f} s", duration = 3)
|
438 |
|
439 |
-
video_dis0 = f"""<video controls playsinline width="{width}" style="display: block; margin: 0 auto;" src="
|
440 |
-
video_dis1 = f"""<video controls playsinline width="{width}" style="display: block; margin: 0 auto;" src="
|
441 |
-
video_dis2 = f"""<video controls playsinline width="{width}" style="display: block; margin: 0 auto;" src="
|
442 |
|
443 |
edit_config = set_all_use_to_false(edit_config)
|
444 |
return video_dis0, video_dis2
|
|
|
85 |
<h1>MotionCLR: Motion Generation and Training-free Editing via Understanding Attention Mechanisms</h1>
|
86 |
<h3>
|
87 |
<a href="https://lhchen.top" target="_blank" rel="noopener noreferrer">Ling-Hao Chen</a><sup>1, 2</sup>,
|
88 |
+
<a href="https://https://github.com/Dai-Wenxun" target="_blank" rel="noopener noreferrer">Wenxun Dai</a><sup>1</sup>,
|
89 |
+
<a href="https://juxuan27.github.io/" target="_blank" rel="noopener noreferrer">Xuan Ju</a><sup>3</sup>,
|
90 |
<a href="https://shunlinlu.github.io" target="_blank" rel="noopener noreferrer">Shunlin Lu</a><sup>4</sup>,
|
91 |
<a href="https://leizhang.org" target="_blank" rel="noopener noreferrer">Lei Zhang</a><sup>🤗 2</sup>
|
92 |
</h3>
|
|
|
195 |
exc = end_time - start_time
|
196 |
gr.Info(f"Rendering time cost: {exc:.2f} s", duration = 3)
|
197 |
|
198 |
+
video_dis = f'<video controls playsinline width="{width}" style="display: block; margin: 0 auto;" src="/gradio_api/file={save_path}"></video>'
|
199 |
style_dis = video_dis + """<br> <p align="center"> Content Reference </p>"""
|
200 |
global edit_config
|
201 |
edit_config = set_all_use_to_false(edit_config)
|
|
|
274 |
exc = end_time - start_time
|
275 |
gr.Info(f"Rendering time cost: {exc:.2f} s", duration = 3)
|
276 |
|
277 |
+
video_dis = f'<video controls playsinline width="{width}" style="display: block; margin: 0 auto;" src="/gradio_api/file={save_paths[1]}"></video>'
|
278 |
|
279 |
|
280 |
edit_config = set_all_use_to_false(edit_config)
|
|
|
352 |
kinematic_tree = paramUtil.t2m_kinematic_chain if (opt.dataset_name == 't2m') else paramUtil.kit_kinematic_chain
|
353 |
plot_3d_motion(save_paths[i], kinematic_tree, motion, title=title, fps=opt.fps, radius=opt.radius)
|
354 |
video_html = f'''
|
355 |
+
<video class="retrieved_video" width="{width}" height="{height}" preload="auto" muted playsinline onpause="this.load()" autoplay loop disablepictureinpicture src="/gradio_api/file=={save_paths[i]}"> </video>
|
356 |
'''
|
357 |
video_dis.append(video_html)
|
358 |
i += 1
|
|
|
436 |
exc = end_time - start_time
|
437 |
gr.Info(f"Rendering time cost: {exc:.2f} s", duration = 3)
|
438 |
|
439 |
+
video_dis0 = f"""<video controls playsinline width="{width}" style="display: block; margin: 0 auto;" src="/gradio_api/file={save_paths[0]}"></video> <br> <p align="center"> Style Reference </p>"""
|
440 |
+
video_dis1 = f"""<video controls playsinline width="{width}" style="display: block; margin: 0 auto;" src="/gradio_api/file={save_paths[2]}"></video> <br> <p align="center"> Content Reference </p>"""
|
441 |
+
video_dis2 = f"""<video controls playsinline width="{width}" style="display: block; margin: 0 auto;" src="/gradio_api/file={save_paths[1]}"></video> <br> <p align="center"> Transfered Result </p>"""
|
442 |
|
443 |
edit_config = set_all_use_to_false(edit_config)
|
444 |
return video_dis0, video_dis2
|