Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -43,6 +43,16 @@ def inference(input_img, transparency = 0.5, target_layer_number = -1):
|
|
43 |
title = "CIFAR10 trained on ResNet18 Model with GradCAM"
|
44 |
description = "Gradio interface to infer on ResNet18 model, and get GradCAM results"
|
45 |
examples = [["cat.jpg", 0.5, -1], ["dog.jpg", 0.5, -1]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
demo = gr.Interface(
|
47 |
inference,
|
48 |
inputs = [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?")],
|
|
|
43 |
title = "CIFAR10 trained on ResNet18 Model with GradCAM"
|
44 |
description = "Gradio interface to infer on ResNet18 model, and get GradCAM results"
|
45 |
examples = [["cat.jpg", 0.5, -1], ["dog.jpg", 0.5, -1]]
|
46 |
+
demo = gr.Interface(
|
47 |
+
inference,
|
48 |
+
inputs = [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?")],
|
49 |
+
outputs = [gr.Label(num_top_classes=3), gr.Image(shape=(32, 32), label="Output").style(width=128, height=128)],
|
50 |
+
title = title,
|
51 |
+
description = description,
|
52 |
+
examples = examples,
|
53 |
+
)
|
54 |
+
demo.launch()
|
55 |
+
|
56 |
demo = gr.Interface(
|
57 |
inference,
|
58 |
inputs = [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?")],
|