Update app.py
Browse files
app.py
CHANGED
|
@@ -254,13 +254,13 @@ def upload_file(filepath):
|
|
| 254 |
|
| 255 |
|
| 256 |
def update_image(filepath):
|
| 257 |
-
img = imread(filepath)
|
| 258 |
-
img = normalize99(img)
|
| 259 |
-
img = np.clip(img, 0, 1)
|
| 260 |
|
| 261 |
#b1 = gr.DownloadButton("Download masks as TIFF", visible=False)
|
| 262 |
#b2 = gr.DownloadButton("Download outline image as PNG", visible=False)
|
| 263 |
-
return
|
| 264 |
|
| 265 |
with gr.Blocks(title = "Hello",
|
| 266 |
css=".gradio-container {background:purple;}") as demo:
|
|
@@ -305,9 +305,9 @@ with gr.Blocks(title = "Hello",
|
|
| 305 |
sample_list.append("samples/img%0.2d.png"%j)
|
| 306 |
gr.Examples(sample_list, inputs=input_image, examples_per_page=25, label = "Click on an example to try it")
|
| 307 |
|
| 308 |
-
|
| 309 |
up_btn.upload(upload_file, up_btn, [input_image])
|
| 310 |
-
send_btn.click(cellpose_segment, [
|
| 311 |
|
| 312 |
#down_btn.click(download_function, None, [down_btn, down_btn2])
|
| 313 |
|
|
|
|
| 254 |
|
| 255 |
|
| 256 |
def update_image(filepath):
|
| 257 |
+
#img = imread(filepath)
|
| 258 |
+
#img = normalize99(img)
|
| 259 |
+
#img = np.clip(img, 0, 1)
|
| 260 |
|
| 261 |
#b1 = gr.DownloadButton("Download masks as TIFF", visible=False)
|
| 262 |
#b2 = gr.DownloadButton("Download outline image as PNG", visible=False)
|
| 263 |
+
return filepath#, b1, b2
|
| 264 |
|
| 265 |
with gr.Blocks(title = "Hello",
|
| 266 |
css=".gradio-container {background:purple;}") as demo:
|
|
|
|
| 305 |
sample_list.append("samples/img%0.2d.png"%j)
|
| 306 |
gr.Examples(sample_list, inputs=input_image, examples_per_page=25, label = "Click on an example to try it")
|
| 307 |
|
| 308 |
+
input_image.upload(update_image, input_image, up_btn)
|
| 309 |
up_btn.upload(upload_file, up_btn, [input_image])
|
| 310 |
+
send_btn.click(cellpose_segment, [up_btn, resize], [img_outlines, flows, down_btn, down_btn2])
|
| 311 |
|
| 312 |
#down_btn.click(download_function, None, [down_btn, down_btn2])
|
| 313 |
|