theschoolofai commited on
Commit
221e80f
·
1 Parent(s): 6457fca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -36,5 +36,8 @@ def inference(input_img, transparency, target_layer_number):
36
  visualization = show_cam_on_image(rgb_img, grayscale_cam, use_rgb=True, image_weight=transparency)
37
  return classes[prediction[0].item()], visualization
38
 
39
- demo = gr.Interface(inference, [gr.Image(shape=(32, 32), label="Input Image"), gr.Slider(0, 1, value = 0.5, label="Opacity of GradCAM"), gr.Slider(-5, -1, value = -2, step=1, label="Which Layer?")], ["text", gr.Image(shape=(32, 32), label="Output").style(width=128, height=128)])
 
 
 
40
  demo.launch()
 
36
  visualization = show_cam_on_image(rgb_img, grayscale_cam, use_rgb=True, image_weight=transparency)
37
  return classes[prediction[0].item()], visualization
38
 
39
+ title = "CIFAR10 trained on ResNet18 Model with GradCAM"
40
+ description = "A simple Gradio interface to infer on ResNet model, and get GradCAM results"
41
+ examples = [["cat.jpg", "dog.jpg"]]
42
+ demo = gr.Interface(inference, [gr.Image(shape=(32, 32), label="Input Image"), gr.Slider(0, 1, value = 0.5, label="Opacity of GradCAM"), gr.Slider(-2, -1, value = -2, step=1, label="Which Layer?")], ["text", gr.Image(shape=(32, 32), label="Output").style(width=128, height=128)])
43
  demo.launch()