padmanabhbosamia commited on
Commit
9c8a691
·
1 Parent(s): 5f71bd1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -61,7 +61,7 @@ def show_misclassified_images_wrapper(num_images=10, use_gradcam=False, gradcam_
61
 
62
  return model.show_misclassified_images(num_images, use_gradcam, gradcam_layer, transparency)
63
 
64
- description1 = "Test the model's prediction. Currently the model only supports the following classes - plane, car, bird, cat, deer, dog, frog, horse, ship, truck."
65
 
66
 
67
  # Define the full path to the images folder
@@ -85,22 +85,22 @@ input_interface = gr.Interface(inference,
85
  inputs=[gr.Image(shape=(32, 32), label="Input Image"),
86
  gr.Slider(0, 1, value=0.5, label="Opacity of GradCAM"),
87
  gr.Slider(-2, -1, value=-2, step=1, label="Which Layer?"),
88
- gr.Slider(1, 10, value=3, step=1, label="How many top confidence classes to be shown?")],
89
  outputs=[gr.Label(),
90
- gr.Image(shape=(32, 32), label="Model Prediction").style(width=300, height=300)],
91
  description=description1,examples=examples)
92
 
93
  description2 = "Missclassfied Images"
94
 
95
  # Create a separate interface for the "Misclassified Images" tab
96
  misclassified_interface = gr.Interface(show_misclassified_images_wrapper,
97
- inputs=[gr.Number(value=10, label="Number of images to display"),
98
  gr.Radio(["Yes", "No"], value="No" , label="Show GradCAM outputs"),
99
  gr.Slider(-2, -1, value=-1, step=1, label="Which layer for GradCAM?"),
100
  gr.Slider(0, 1, value=0.5, label="Opacity of GradCAM")],
101
  outputs=gr.Plot(), description=description2)
102
 
103
  demo = gr.TabbedInterface([input_interface, misclassified_interface], tab_names=["Input an image", "Misclassified Images"],
104
- title="Custom Resnet on CIFAR10 using GradCAM")
105
 
106
  demo.launch()
 
61
 
62
  return model.show_misclassified_images(num_images, use_gradcam, gradcam_layer, transparency)
63
 
64
+ description1 = "Supported Only - plane, car, bird, cat, deer, dog, frog, horse, ship, truck."
65
 
66
 
67
  # Define the full path to the images folder
 
85
  inputs=[gr.Image(shape=(32, 32), label="Input Image"),
86
  gr.Slider(0, 1, value=0.5, label="Opacity of GradCAM"),
87
  gr.Slider(-2, -1, value=-2, step=1, label="Which Layer?"),
88
+ gr.Slider(1, 10, value=3, step=1, label="How many classes")],
89
  outputs=[gr.Label(),
90
+ gr.Image(shape=(32, 32), label="Predicted Output").style(width=300, height=300)],
91
  description=description1,examples=examples)
92
 
93
  description2 = "Missclassfied Images"
94
 
95
  # Create a separate interface for the "Misclassified Images" tab
96
  misclassified_interface = gr.Interface(show_misclassified_images_wrapper,
97
+ inputs=[gr.Number(value=10, label="Number of Images for display"),
98
  gr.Radio(["Yes", "No"], value="No" , label="Show GradCAM outputs"),
99
  gr.Slider(-2, -1, value=-1, step=1, label="Which layer for GradCAM?"),
100
  gr.Slider(0, 1, value=0.5, label="Opacity of GradCAM")],
101
  outputs=gr.Plot(), description=description2)
102
 
103
  demo = gr.TabbedInterface([input_interface, misclassified_interface], tab_names=["Input an image", "Misclassified Images"],
104
+ title="Gradcam using Cifar10 with CustomResnet Model")
105
 
106
  demo.launch()