rathapech commited on
Commit
6c76059
·
verified ·
1 Parent(s): b4d9e20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -12,11 +12,13 @@ def get_pipeline_prediction(pil_image):
12
  pipeline_output = od_pipe(pil_image)
13
  text = summarize_predictions_natural_language(pipeline_output)
14
  #text = "Hello, my name is Ratha"
15
- gen_audio = tts_pipe(text)
16
  processed_image = render_results_in_image(pil_image,
17
  pipeline_output)
 
18
  rate= gen_audio["sampling_rate"]
19
- return processed_image, text, (rate, gen_audio["audio"][0])
 
20
 
21
  demo = gr.Interface(
22
  fn=get_pipeline_prediction,
@@ -24,8 +26,9 @@ demo = gr.Interface(
24
  type="pil"),
25
  outputs= [
26
  gr.Image(label="Output image with predicted instances", type="pil"),
27
- gr.Textbox(label="Prediction Summary"),
28
- gr.Audio(label="Generated Speech")]
 
29
  )
30
 
31
  demo.launch()
 
12
  pipeline_output = od_pipe(pil_image)
13
  text = summarize_predictions_natural_language(pipeline_output)
14
  #text = "Hello, my name is Ratha"
15
+
16
  processed_image = render_results_in_image(pil_image,
17
  pipeline_output)
18
+ gen_audio = tts_pipe(text)
19
  rate= gen_audio["sampling_rate"]
20
+ return processed_image, text
21
+ #, (rate, gen_audio["audio"][0])
22
 
23
  demo = gr.Interface(
24
  fn=get_pipeline_prediction,
 
26
  type="pil"),
27
  outputs= [
28
  gr.Image(label="Output image with predicted instances", type="pil"),
29
+ gr.Textbox(label="Prediction Summary")
30
+ #,gr.Audio(label="Generated Speech")
31
+ ]
32
  )
33
 
34
  demo.launch()