Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -234,7 +234,7 @@ def update(filepath, filepath_result, filepath_coordinates, z, c):
|
|
| 234 |
|
| 235 |
return (filepath_show, display_boxes), (filepath_result_show, display_boxes)
|
| 236 |
|
| 237 |
-
def detect_cells(filepath, c, model, rescale_z, rescale_xy):
|
| 238 |
|
| 239 |
model = tf.keras.models.load_model(model_adresses[model], compile=False)
|
| 240 |
|
|
@@ -281,7 +281,7 @@ def detect_cells(filepath, c, model, rescale_z, rescale_xy):
|
|
| 281 |
|
| 282 |
#display_boxes = filter_coordinates(filepath_coordinates, z)
|
| 283 |
|
| 284 |
-
return filepath_result, filepath_coordinates#, (filepath_result_show, display_boxes)
|
| 285 |
|
| 286 |
def pad(img, z_tile = 32, z_buffer=2, xy_tile = 32):
|
| 287 |
|
|
@@ -424,7 +424,7 @@ with gr.Blocks(title = "Hello",
|
|
| 424 |
#depth.change(update_depth, [up_btn, depth], depth)
|
| 425 |
|
| 426 |
# Prediction
|
| 427 |
-
send_btn.click(detect_cells, [up_btn, channel, model, rescale_z, rescale_xy], [down_btn, down_btn2]).then(update, [up_btn, down_btn, down_btn2, depth, channel], [input_image, output_image])# flows, down_btn, down_btn2])
|
| 428 |
|
| 429 |
#down_btn.click(download_function, None, [down_btn, down_btn2])
|
| 430 |
|
|
|
|
| 234 |
|
| 235 |
return (filepath_show, display_boxes), (filepath_result_show, display_boxes)
|
| 236 |
|
| 237 |
+
def detect_cells(filepath, c, model, rescale_z, rescale_xy, progress=gr.Progress()):
|
| 238 |
|
| 239 |
model = tf.keras.models.load_model(model_adresses[model], compile=False)
|
| 240 |
|
|
|
|
| 281 |
|
| 282 |
#display_boxes = filter_coordinates(filepath_coordinates, z)
|
| 283 |
|
| 284 |
+
return filepath_result, filepath_coordinates, (fp0, [((5, 5, 10, 10), 'nothing')])#, (filepath_result_show, display_boxes)
|
| 285 |
|
| 286 |
def pad(img, z_tile = 32, z_buffer=2, xy_tile = 32):
|
| 287 |
|
|
|
|
| 424 |
#depth.change(update_depth, [up_btn, depth], depth)
|
| 425 |
|
| 426 |
# Prediction
|
| 427 |
+
send_btn.click(detect_cells, [up_btn, channel, model, rescale_z, rescale_xy], [ down_btn, down_btn2, output_image]).then(update, [up_btn, down_btn, down_btn2, depth, channel], [input_image, output_image])# flows, down_btn, down_btn2])
|
| 428 |
|
| 429 |
#down_btn.click(download_function, None, [down_btn, down_btn2])
|
| 430 |
|