Spaces:
Running on Zero
Running on Zero
fixes to elem_classes
Browse files
app.py
CHANGED
|
@@ -102,7 +102,7 @@ def sample_predict(image,truth_labels=None):
|
|
| 102 |
return {LABELS[i]: float(probabilities[i]) for i in range(len(LABELS))}
|
| 103 |
|
| 104 |
custom_css = """
|
| 105 |
-
.
|
| 106 |
object-fit: fill !important;
|
| 107 |
width: 100% !important;
|
| 108 |
height: 100% !important;
|
|
@@ -110,10 +110,10 @@ custom_css = """
|
|
| 110 |
}
|
| 111 |
"""
|
| 112 |
|
| 113 |
-
with gradio.Blocks() as demo:
|
| 114 |
gradio.Markdown("# PathMNIST Image Classification")
|
| 115 |
|
| 116 |
-
with gradio.Tab("Predict",
|
| 117 |
gradio.Markdown("## Upload a tissue image for classification")
|
| 118 |
with gradio.Row():
|
| 119 |
input_img = gradio.Image(height=512, width=512)
|
|
@@ -122,7 +122,7 @@ with gradio.Blocks() as demo:
|
|
| 122 |
btn = gradio.Button("Predict")
|
| 123 |
btn.click(fn=predict, inputs=input_img, outputs=output_lbl)
|
| 124 |
|
| 125 |
-
with gradio.Tab("Examples (Validation)",
|
| 126 |
gradio.Markdown("## Select an example below to test the model against the PathMNIST validation dataset")
|
| 127 |
|
| 128 |
with gradio.Row():
|
|
@@ -139,7 +139,7 @@ with gradio.Blocks() as demo:
|
|
| 139 |
cache_examples=True,
|
| 140 |
)
|
| 141 |
|
| 142 |
-
with gradio.Tab("Examples (Test)",
|
| 143 |
gradio.Markdown("## Select an example below to test the model against the PathMNIST test dataset")
|
| 144 |
|
| 145 |
with gradio.Row():
|
|
|
|
| 102 |
return {LABELS[i]: float(probabilities[i]) for i in range(len(LABELS))}
|
| 103 |
|
| 104 |
custom_css = """
|
| 105 |
+
.tab img{
|
| 106 |
object-fit: fill !important;
|
| 107 |
width: 100% !important;
|
| 108 |
height: 100% !important;
|
|
|
|
| 110 |
}
|
| 111 |
"""
|
| 112 |
|
| 113 |
+
with gradio.Blocks(css=custom_css) as demo:
|
| 114 |
gradio.Markdown("# PathMNIST Image Classification")
|
| 115 |
|
| 116 |
+
with gradio.Tab("Predict", elem_classes="tab"):
|
| 117 |
gradio.Markdown("## Upload a tissue image for classification")
|
| 118 |
with gradio.Row():
|
| 119 |
input_img = gradio.Image(height=512, width=512)
|
|
|
|
| 122 |
btn = gradio.Button("Predict")
|
| 123 |
btn.click(fn=predict, inputs=input_img, outputs=output_lbl)
|
| 124 |
|
| 125 |
+
with gradio.Tab("Examples (Validation)", elem_classes="tab"):
|
| 126 |
gradio.Markdown("## Select an example below to test the model against the PathMNIST validation dataset")
|
| 127 |
|
| 128 |
with gradio.Row():
|
|
|
|
| 139 |
cache_examples=True,
|
| 140 |
)
|
| 141 |
|
| 142 |
+
with gradio.Tab("Examples (Test)", elem_classes="tab"):
|
| 143 |
gradio.Markdown("## Select an example below to test the model against the PathMNIST test dataset")
|
| 144 |
|
| 145 |
with gradio.Row():
|