Spaces:
Sleeping
Sleeping
gradio interface
Browse files
app.py
CHANGED
|
@@ -50,39 +50,34 @@ def analyze_slide(slide_path, site_type):
|
|
| 50 |
|
| 51 |
return aeon_results, paladin_results
|
| 52 |
|
| 53 |
-
|
| 54 |
-
gr.
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
paladin_output_table = gr.Dataframe(
|
| 74 |
-
headers=["Cancer Subtype", "Biomarker", "Score"],
|
| 75 |
-
label="Biomarker Inference",
|
| 76 |
-
datatype=["str", "str", "number"],
|
| 77 |
-
)
|
| 78 |
-
|
| 79 |
|
| 80 |
-
|
| 81 |
-
analyze_slide,
|
| 82 |
inputs=[input_slide, input_dropdown],
|
| 83 |
outputs=[aeon_output_table, paladin_output_table],
|
| 84 |
-
|
|
|
|
|
|
|
| 85 |
)
|
| 86 |
|
| 87 |
-
|
| 88 |
-
demo.launch(enable_queue=True)
|
|
|
|
| 50 |
|
| 51 |
return aeon_results, paladin_results
|
| 52 |
|
| 53 |
+
if __name__ == "__main__":
|
| 54 |
+
input_slide = gr.File(
|
| 55 |
+
label="Upload H&E Whole Slide Image",
|
| 56 |
+
file_types=[".svs", ".tiff", ".tif"],
|
| 57 |
+
)
|
| 58 |
+
input_dropdown = gr.Dropdown(
|
| 59 |
+
choices=["Primary", "Metastatic"],
|
| 60 |
+
label="Site Type",
|
| 61 |
+
value="Primary",
|
| 62 |
+
)
|
| 63 |
+
aeon_output_table = gr.Dataframe(
|
| 64 |
+
headers=["Cancer Subtype", "Confidence"],
|
| 65 |
+
label="Cancer Subtype Inference",
|
| 66 |
+
datatype=["str", "number"],
|
| 67 |
+
)
|
| 68 |
+
paladin_output_table = gr.Dataframe(
|
| 69 |
+
headers=["Cancer Subtype", "Biomarker", "Score"],
|
| 70 |
+
label="Biomarker Inference",
|
| 71 |
+
datatype=["str", "str", "number"],
|
| 72 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
+
iface = gr.Interface(
|
| 75 |
+
fn=analyze_slide,
|
| 76 |
inputs=[input_slide, input_dropdown],
|
| 77 |
outputs=[aeon_output_table, paladin_output_table],
|
| 78 |
+
title="Mosaic: H&E Whole Slide Image Cancer Subtype and Biomarker Inference",
|
| 79 |
+
description="Upload an H&E whole slide image and select the site type to infer cancer subtype and biomarkers.",
|
| 80 |
+
allow_flagging="never",
|
| 81 |
)
|
| 82 |
|
| 83 |
+
iface.launch(enable_queue=True)
|
|
|