pragnakalp commited on
Commit
a2724b9
·
1 Parent(s): 943514f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -43,7 +43,7 @@ def calculate(image_in, audio_in):
43
  image = Image.open(image_in)
44
  image = pad_image(image)
45
  image.save("image.png")
46
- return image
47
  pocketsphinx_run = subprocess.run(['pocketsphinx', '-phone_align', 'yes', 'single', '/content/audio.wav'], check=True, capture_output=True)
48
  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)
49
  with open("test.json", "w") as f:
@@ -104,7 +104,7 @@ def run():
104
  # audio_in = gr.Audio(show_label=False, type='filepath')
105
  input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text")
106
  gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
107
- video_out = gr.Image(label="output")
108
  # video_out = gr.Video(show_label=False)
109
  with gr.Row().style(equal_height=True):
110
  btn = gr.Button("Generate")
 
43
  image = Image.open(image_in)
44
  image = pad_image(image)
45
  image.save("image.png")
46
+ return audio_in
47
  pocketsphinx_run = subprocess.run(['pocketsphinx', '-phone_align', 'yes', 'single', '/content/audio.wav'], check=True, capture_output=True)
48
  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)
49
  with open("test.json", "w") as f:
 
104
  # audio_in = gr.Audio(show_label=False, type='filepath')
105
  input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text")
106
  gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
107
+ video_out = gr.Audio(label="output")
108
  # video_out = gr.Video(show_label=False)
109
  with gr.Row().style(equal_height=True):
110
  btn = gr.Button("Generate")