pragnakalp commited on
Commit
6e73a3b
·
1 Parent(s): 0a88e7f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -39,7 +39,7 @@ def one_shot(image,input_text,gender):
39
  image = pad_image(image)
40
  image.save("/content/image_pre.png")
41
  print("Print 2")
42
- return "/content/audio.wav"
43
  exit()
44
  pocketsphinx_run = subprocess.run(['pocketsphinx', '-phone_align', 'yes', 'single', '/content/audio.wav'], check=True, capture_output=True)
45
  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)
@@ -102,7 +102,7 @@ def run():
102
  # audio_in = gr.Audio(show_label=False, type='filepath')
103
  input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text")
104
  gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
105
- video_out = gr.Audio(label="output")
106
  # video_out = gr.Video(show_label=False)
107
  with gr.Row().style(equal_height=True):
108
  btn = gr.Button("Generate")
 
39
  image = pad_image(image)
40
  image.save("/content/image_pre.png")
41
  print("Print 2")
42
+ return "/content/image_pre.png"
43
  exit()
44
  pocketsphinx_run = subprocess.run(['pocketsphinx', '-phone_align', 'yes', 'single', '/content/audio.wav'], check=True, capture_output=True)
45
  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)
 
102
  # audio_in = gr.Audio(show_label=False, type='filepath')
103
  input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text")
104
  gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
105
+ video_out = gr.Image(label="output")
106
  # video_out = gr.Video(show_label=False)
107
  with gr.Row().style(equal_height=True):
108
  btn = gr.Button("Generate")