Commit
·
7fe7935
1
Parent(s):
2d50988
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,7 @@ def calculate(image_in, audio_in):
|
|
30 |
jq_run = subprocess.run(['jq', '[.w[]|{word: (.t | ascii_upcase | sub("<S>"; "sil") | sub("<SIL>"; "sil") | sub("\\\(2\\\)"; "") | sub("\\\(3\\\)"; "") | sub("\\\(4\\\)"; "") | sub("\\\[SPEECH\\\]"; "SIL") | sub("\\\[NOISE\\\]"; "SIL")), phones: [.w[]|{ph: .t | sub("\\\+SPN\\\+"; "SIL") | sub("\\\+NSN\\\+"; "SIL"), bg: (.b*100)|floor, ed: (.b*100+.d*100)|floor}]}]'], input=pocketsphinx_run.stdout, capture_output=True)
|
31 |
with open("test.json", "w") as f:
|
32 |
f.write(jq_run.stdout.decode('utf-8').strip())
|
33 |
-
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
34 |
-
model = model.to(device)
|
35 |
os.system(f"cd /content/one-shot-talking-face && python3 -B test_script.py --img_path /content/image.png --audio_path /content/audio.wav --phoneme_path /content/test.json --save_dir /content/train")
|
36 |
return "/content/train/image_audio.mp4"
|
37 |
|
|
|
30 |
jq_run = subprocess.run(['jq', '[.w[]|{word: (.t | ascii_upcase | sub("<S>"; "sil") | sub("<SIL>"; "sil") | sub("\\\(2\\\)"; "") | sub("\\\(3\\\)"; "") | sub("\\\(4\\\)"; "") | sub("\\\[SPEECH\\\]"; "SIL") | sub("\\\[NOISE\\\]"; "SIL")), phones: [.w[]|{ph: .t | sub("\\\+SPN\\\+"; "SIL") | sub("\\\+NSN\\\+"; "SIL"), bg: (.b*100)|floor, ed: (.b*100+.d*100)|floor}]}]'], input=pocketsphinx_run.stdout, capture_output=True)
|
31 |
with open("test.json", "w") as f:
|
32 |
f.write(jq_run.stdout.decode('utf-8').strip())
|
33 |
+
# device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
|
34 |
os.system(f"cd /content/one-shot-talking-face && python3 -B test_script.py --img_path /content/image.png --audio_path /content/audio.wav --phoneme_path /content/test.json --save_dir /content/train")
|
35 |
return "/content/train/image_audio.mp4"
|
36 |
|