imagescientist commited on
Commit
efa831e
·
1 Parent(s): 7ba3706

Fix function return

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -29,7 +29,9 @@ def process_zebrafish_image(img):
29
  # with out_pl_mask: pred.show(alpha=1, vmin=0, vmax=3, title='mask')
30
  # lbl_pred.value = f'Predicted age: {age[0]};'
31
  #return dict(zip(pred, map(float,age)))
32
- return [T.ToPILImage(pred), dict(zip("Age prediction", map(float,age)))]
 
 
33
 
34
  intf = gr.Interface(fn=process_zebrafish_image, inputs=gr.inputs.Image(shape=(512, 512)), outputs=[gr.outputs.Image(), gr.outputs.Label()]).launch(share=True)
35
  intf.launch(inline=False)
 
29
  # with out_pl_mask: pred.show(alpha=1, vmin=0, vmax=3, title='mask')
30
  # lbl_pred.value = f'Predicted age: {age[0]};'
31
  #return dict(zip(pred, map(float,age)))
32
+ image_out = T.ToPILImage(pred)
33
+ text_out = dict(zip("Age prediction", map(float,age)))
34
+ return (image_out, text_out )
35
 
36
  intf = gr.Interface(fn=process_zebrafish_image, inputs=gr.inputs.Image(shape=(512, 512)), outputs=[gr.outputs.Image(), gr.outputs.Label()]).launch(share=True)
37
  intf.launch(inline=False)