Hali5 commited on
Commit
2ff7019
·
1 Parent(s): bb06753

fixes to elem_classes

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- .gradio-container img {
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",css=custom_css):
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)",css=custom_css):
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)",css=custom_css):
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():