Spaces:
Runtime error
Runtime error
Commit
·
eb54aba
1
Parent(s):
03f3e3c
add
Browse files
app.py
CHANGED
|
@@ -322,15 +322,17 @@ class BaseTrainer(object):
|
|
| 322 |
mocap_frame_rate = 30,
|
| 323 |
)
|
| 324 |
total_length += n
|
| 325 |
-
render_vid_path =
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
|
|
|
|
|
|
| 334 |
|
| 335 |
result = [
|
| 336 |
gr.Video(value=render_vid_path, visible=True),
|
|
@@ -741,15 +743,21 @@ def _warp_create_cuda_model(args,model,mean_upper,mean_hands,mean_lower,std_uppe
|
|
| 741 |
|
| 742 |
|
| 743 |
@logger.catch
|
| 744 |
-
def syntalker(audio_path,sample_stratege):
|
| 745 |
args = config.parse_args()
|
|
|
|
|
|
|
| 746 |
print("sample_stratege",sample_stratege)
|
| 747 |
if sample_stratege==0:
|
| 748 |
args.use_ddim=True
|
| 749 |
elif sample_stratege==1:
|
| 750 |
args.use_ddim=False
|
| 751 |
-
|
| 752 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 753 |
print(sample_stratege)
|
| 754 |
print(args.use_ddim)
|
| 755 |
#os.environ['TRANSFORMERS_CACHE'] = args.data_path_1 + "hub/"
|
|
@@ -780,6 +788,7 @@ demo = gr.Interface(
|
|
| 780 |
# gr.File(label="Please upload SMPL-X file with npz format here.", file_types=["npz", "NPZ"]),
|
| 781 |
gr.Audio(),
|
| 782 |
gr.Radio(choices=["DDIM", "DDPM"], label="Please select a sample strategy", type="index", value="DDIM"), # 0 for DDIM, 1 for DDPM
|
|
|
|
| 783 |
# gr.File(label="Please upload textgrid format file here.", file_types=["TextGrid", "Textgrid", "textgrid"])
|
| 784 |
], # input type
|
| 785 |
outputs=[
|
|
|
|
| 322 |
mocap_frame_rate = 30,
|
| 323 |
)
|
| 324 |
total_length += n
|
| 325 |
+
render_vid_path = None
|
| 326 |
+
if self.args.render_video:
|
| 327 |
+
render_vid_path = other_tools_hf.render_one_sequence_no_gt(
|
| 328 |
+
results_npz_file_save_path,
|
| 329 |
+
# results_save_path+"gt_"+test_seq_list.iloc[its]['id']+'.npz',
|
| 330 |
+
results_save_path,
|
| 331 |
+
self.audio_path,
|
| 332 |
+
self.args.data_path_1+"smplx_models/",
|
| 333 |
+
use_matplotlib = False,
|
| 334 |
+
args = self.args,
|
| 335 |
+
)
|
| 336 |
|
| 337 |
result = [
|
| 338 |
gr.Video(value=render_vid_path, visible=True),
|
|
|
|
| 743 |
|
| 744 |
|
| 745 |
@logger.catch
|
| 746 |
+
def syntalker(audio_path,sample_stratege,render_video):
|
| 747 |
args = config.parse_args()
|
| 748 |
+
args.use_ddim=True
|
| 749 |
+
args.render_video=True
|
| 750 |
print("sample_stratege",sample_stratege)
|
| 751 |
if sample_stratege==0:
|
| 752 |
args.use_ddim=True
|
| 753 |
elif sample_stratege==1:
|
| 754 |
args.use_ddim=False
|
| 755 |
+
|
| 756 |
+
if render_video==0:
|
| 757 |
+
args.render_video=True
|
| 758 |
+
elif render_video==1:
|
| 759 |
+
args.render_video=False
|
| 760 |
+
|
| 761 |
print(sample_stratege)
|
| 762 |
print(args.use_ddim)
|
| 763 |
#os.environ['TRANSFORMERS_CACHE'] = args.data_path_1 + "hub/"
|
|
|
|
| 788 |
# gr.File(label="Please upload SMPL-X file with npz format here.", file_types=["npz", "NPZ"]),
|
| 789 |
gr.Audio(),
|
| 790 |
gr.Radio(choices=["DDIM", "DDPM"], label="Please select a sample strategy", type="index", value="DDIM"), # 0 for DDIM, 1 for DDPM
|
| 791 |
+
gr.Radio(choices=["Yes", "No"], label="Please select whether render video or not, it will additionally take 10 mintues for rendering", type="index", value="Yes"), # 0 for DDIM, 1 for DDPM
|
| 792 |
# gr.File(label="Please upload textgrid format file here.", file_types=["TextGrid", "Textgrid", "textgrid"])
|
| 793 |
], # input type
|
| 794 |
outputs=[
|