wgetdd commited on
Commit
2932f27
1 Parent(s): 4eee11e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -31,12 +31,13 @@ show_gradcam_checkbox = gr.inputs.Checkbox(default=False, label="Show GradCAM Ou
31
 
32
  # Slider for adjusting the opacity of the GradCAM overlay
33
  opacity_slider = gr.inputs.Slider(minimum=0, maximum=1, default=0.7,step=0.1, label="GradCAM Opacity")
34
-
 
35
  gr.Interface(
36
- fn=lambda image, num_of_output_classes,show_misclassified, num_images, show_gradcam, opacity: [main_inference(num_of_output_classes,classes,model,image),
37
  get_misclassified_images(show_misclassified, num_images) if show_misclassified else None,
38
- get_gradcam(model,image, opacity) if show_gradcam else None],
39
- inputs=[input_component, num_of_output_classes,show_misclassified_checkbox, num_images_input, show_gradcam_checkbox, opacity_slider],
40
  outputs=[gr.outputs.Label(), gr.Image(shape=(500, 500)), gr.Image(shape=(500, 500))],
41
  title="CIFAR10 Trained on Custom Residual CNN Architecture",
42
  examples=[
 
31
 
32
  # Slider for adjusting the opacity of the GradCAM overlay
33
  opacity_slider = gr.inputs.Slider(minimum=0, maximum=1, default=0.7,step=0.1, label="GradCAM Opacity")
34
+ layer_options = ['layer1', 'layer2', 'layer3']
35
+ layer_input = gr.inputs.Dropdown(layer_options,label="Select a Layer",default="layer3")
36
  gr.Interface(
37
+ fn=lambda image, num_of_output_classes,show_misclassified, num_images, show_gradcam, opacity,layer: [main_inference(num_of_output_classes,classes,model,image),
38
  get_misclassified_images(show_misclassified, num_images) if show_misclassified else None,
39
+ get_gradcam(model,image, opacity,layer) if show_gradcam else None],
40
+ inputs=[input_component, num_of_output_classes,show_misclassified_checkbox, num_images_input, show_gradcam_checkbox, opacity_slider,layer_input],
41
  outputs=[gr.outputs.Label(), gr.Image(shape=(500, 500)), gr.Image(shape=(500, 500))],
42
  title="CIFAR10 Trained on Custom Residual CNN Architecture",
43
  examples=[