Update app.py
Browse files
app.py
CHANGED
|
@@ -48,7 +48,7 @@ def gradio_demo(model_name, sequence_input, image):
|
|
| 48 |
device=device,
|
| 49 |
)
|
| 50 |
|
| 51 |
-
return T.ToPILImage()(protein_image), formatted_predicted_sequence
|
| 52 |
|
| 53 |
|
| 54 |
with gr.Blocks() as demo:
|
|
@@ -91,13 +91,19 @@ with gr.Blocks() as demo:
|
|
| 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,7 +116,7 @@ with gr.Blocks() as demo:
|
|
| 110 |
|
| 111 |
inputs = [model_name, sequence_input, nucleus_image]
|
| 112 |
|
| 113 |
-
outputs = [mask, predicted_sequence]
|
| 114 |
|
| 115 |
button.click(gradio_demo, inputs, outputs)
|
| 116 |
|
|
|
|
| 48 |
device=device,
|
| 49 |
)
|
| 50 |
|
| 51 |
+
return T.ToPILImage()(protein_image), T.ToPILImage()(nucleus_image), formatted_predicted_sequence
|
| 52 |
|
| 53 |
|
| 54 |
with gr.Blocks() as demo:
|
|
|
|
| 91 |
type="pil"
|
| 92 |
)
|
| 93 |
|
| 94 |
+
|
| 95 |
+
with gr.Row().style(equal_height=True):
|
| 96 |
+
nucleus_crop = gr.Image(
|
| 97 |
+
label="Nucleus Image (Crop)",
|
| 98 |
+
image_mode="L",
|
| 99 |
+
type="pil"
|
| 100 |
+
)
|
| 101 |
+
|
| 102 |
mask = gr.Image(
|
| 103 |
label="Threshold Image",
|
| 104 |
image_mode="L",
|
| 105 |
type="pil"
|
| 106 |
)
|
|
|
|
|
|
|
| 107 |
with gr.Row():
|
| 108 |
gr.Markdown("Sequence predictions are show below.")
|
| 109 |
|
|
|
|
| 116 |
|
| 117 |
inputs = [model_name, sequence_input, nucleus_image]
|
| 118 |
|
| 119 |
+
outputs = [mask, nucleus_crop, predicted_sequence]
|
| 120 |
|
| 121 |
button.click(gradio_demo, inputs, outputs)
|
| 122 |
|