Emaad commited on
Commit
abaa9d5
·
1 Parent(s): d16a636

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -48,7 +48,7 @@ def gradio_demo(model_name, sequence_input, image):
48
  device=device,
49
  )
50
 
51
- return formatted_predicted_sequence
52
 
53
 
54
  with gr.Blocks() as demo:
@@ -88,9 +88,16 @@ with gr.Blocks() as demo:
88
  label="Nucleus Image",
89
  interactive=True,
90
  image_mode="L",
91
- type="numpy"
92
  )
93
 
 
 
 
 
 
 
 
94
  with gr.Row():
95
  gr.Markdown("Sequence predictions are show below.")
96
 
@@ -103,7 +110,7 @@ with gr.Blocks() as demo:
103
 
104
  inputs = [model_name, sequence_input, nucleus_image]
105
 
106
- outputs = [predicted_sequence]
107
 
108
  button.click(gradio_demo, inputs, outputs)
109
 
 
48
  device=device,
49
  )
50
 
51
+ return T.ToPILImage()(protein_image), formatted_predicted_sequence
52
 
53
 
54
  with gr.Blocks() as demo:
 
88
  label="Nucleus Image",
89
  interactive=True,
90
  image_mode="L",
91
+ type="pil"
92
  )
93
 
94
+ mask = gr.Image(
95
+ label="Threshold Image",
96
+ image_mode="L",
97
+ type="pil"
98
+ )
99
+
100
+
101
  with gr.Row():
102
  gr.Markdown("Sequence predictions are show below.")
103
 
 
110
 
111
  inputs = [model_name, sequence_input, nucleus_image]
112
 
113
+ outputs = [mask, predicted_sequence]
114
 
115
  button.click(gradio_demo, inputs, outputs)
116