mouseland commited on
Commit
2ee7771
·
verified ·
1 Parent(s): e24900f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -114,9 +114,8 @@ def cellpose_segment(img_input):
114
 
115
  outpix = plot_outlines(img_input, masks)
116
  overlay = plot_overlay(img_input, masks)
117
- masks = Image.fromarray(masks)
118
 
119
- return masks # outpix, overlay, flows, masks
120
 
121
  # Gradio Interface
122
  #iface = gr.Interface(
@@ -132,14 +131,15 @@ with gr.Blocks(title = "Hello",
132
 
133
  with gr.Row():
134
  input_image = gr.Image(label = "Input image", type = "numpy")
135
- output_image3 = gr.Image(label = "Output image", type = "pil")
136
 
137
- #with gr.Row():
138
- # output_image2 = gr.Image(label = "Output image", type = "pil")
139
- # output_image3 = gr.Image(label = "Output image", type = "pil")
 
 
 
140
 
141
- send_btn = gr.Button("Infer")
142
- send_btn.click(fn=cellpose_segment, inputs=[input_image], outputs=[output_image3])
143
 
144
 
145
 
 
114
 
115
  outpix = plot_outlines(img_input, masks)
116
  overlay = plot_overlay(img_input, masks)
 
117
 
118
+ return outpix, overlay, flows, masks
119
 
120
  # Gradio Interface
121
  #iface = gr.Interface(
 
131
 
132
  with gr.Row():
133
  input_image = gr.Image(label = "Input image", type = "numpy")
134
+ output_image1 = gr.Image(label = "Output image", type = "numpy")
135
 
136
+ send_btn = gr.Button("Run Cellpose-SAM")
137
+ send_btn.click(fn=cellpose_segment, inputs=[input_image], outputs=[output_image1, output_image2, output_image3])
138
+
139
+ with gr.Row():
140
+ output_image2 = gr.Image(label = "Output image", type = "pil")
141
+ output_image3 = gr.Image(label = "Output image", type = "pil")
142
 
 
 
143
 
144
 
145