Arnab Das commited on
Commit
cf0288d
·
1 Parent(s): 78c0a0e

Modify output

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  import numpy as np
3
  import matplotlib.pyplot as plt
@@ -19,7 +20,11 @@ def process(filepath):
19
  #out_masked = np.ma.masked_less_equal(out, 0.4)
20
  #plt.plot(out_masked, 'r', linewidth=2)
21
  #return str(out), plt
22
- return str(out)
 
 
 
 
23
  demo = gr.Blocks()
24
  file_proc = gr.Interface(
25
  fn=process,
 
1
+ import json
2
  import gradio as gr
3
  import numpy as np
4
  import matplotlib.pyplot as plt
 
20
  #out_masked = np.ma.masked_less_equal(out, 0.4)
21
  #plt.plot(out_masked, 'r', linewidth=2)
22
  #return str(out), plt
23
+ output_json = {}
24
+ output_json["decision_scores"] = str(out)
25
+ response_text = json.dumps(output_json, indent=4)
26
+ return response_text
27
+
28
  demo = gr.Blocks()
29
  file_proc = gr.Interface(
30
  fn=process,