Update app.py
Browse files
app.py
CHANGED
|
@@ -114,8 +114,9 @@ def cellpose_segment(img_input):
|
|
| 114 |
|
| 115 |
outpix = plot_outlines(img_input, masks)
|
| 116 |
overlay = plot_overlay(img_input, masks)
|
| 117 |
-
|
| 118 |
-
|
|
|
|
| 119 |
|
| 120 |
# Gradio Interface
|
| 121 |
#iface = gr.Interface(
|
|
@@ -135,12 +136,13 @@ with gr.Blocks(title = "Hello",
|
|
| 135 |
send_btn = gr.Button("Run Cellpose-SAM")
|
| 136 |
|
| 137 |
with gr.Column(scale=1):
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
|
|
|
| 142 |
|
| 143 |
-
send_btn.click(fn=cellpose_segment, inputs=[input_image], outputs=[
|
| 144 |
|
| 145 |
|
| 146 |
|
|
|
|
| 114 |
|
| 115 |
outpix = plot_outlines(img_input, masks)
|
| 116 |
overlay = plot_overlay(img_input, masks)
|
| 117 |
+
|
| 118 |
+
iperm = np.random.permutation(np.max(masks.flatten()).astype('int')+1)
|
| 119 |
+
return outpix, overlay, flows, iperm[masks]
|
| 120 |
|
| 121 |
# Gradio Interface
|
| 122 |
#iface = gr.Interface(
|
|
|
|
| 136 |
send_btn = gr.Button("Run Cellpose-SAM")
|
| 137 |
|
| 138 |
with gr.Column(scale=1):
|
| 139 |
+
img_outlines = gr.Image(label = "Output image", type = "numpy")
|
| 140 |
+
masks = gr.Image(label = "Output image", type = "numpy")
|
| 141 |
+
img_overlay = gr.Image(label = "Output image", type = "numpy")
|
| 142 |
+
flows = gr.Image(label = "Output image", type = "numpy")
|
| 143 |
+
|
| 144 |
|
| 145 |
+
send_btn.click(fn=cellpose_segment, inputs=[input_image], outputs=[img_outlines, img_overlay, flows, masks])
|
| 146 |
|
| 147 |
|
| 148 |
|