Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -88,7 +88,8 @@ demo = gr.Interface(
|
|
88 |
inputs=[
|
89 |
gr.Radio(["Yes", "No"], label="View GradCAM images?"),
|
90 |
gr.Number(label="Number of GradCAM images to view", default=5, max=10),
|
91 |
-
gr.Textbox(label="Layer name for GradCAM visualization", default="layer4", lines=1),
|
|
|
92 |
gr.Slider(minimum=0.1, maximum=1.0, step=0.1, default=0.5, label="Opacity"),
|
93 |
gr.Radio(["Yes", "No"], label="View misclassified images?"),
|
94 |
gr.Number(label="Number of misclassified images to view", default=5, min=1, max=10),
|
@@ -96,7 +97,7 @@ demo = gr.Interface(
|
|
96 |
gr.Button(label="Submit", type="boolean"),
|
97 |
# gr.Image(shape=(32, 32), label="Input Image"),
|
98 |
# gr.Slider(0, 1, value = 0.5, label="Opacity of GradCAM"),
|
99 |
-
|
100 |
|
101 |
],
|
102 |
outputs = [gr.Label(num_top_classes=3), gr.Image(shape=(32, 32), label="Output").style(width=128, height=128)],
|
@@ -107,7 +108,7 @@ demo = gr.Interface(
|
|
107 |
# Callback function for the Gradio interface
|
108 |
def gradio_callback(view_gradcam, num_gradcam_images, layer_name, opacity,
|
109 |
view_misclassified, num_misclassified_images,
|
110 |
-
input_img,submit
|
111 |
confidence = inference_confidences(input_img, transparency = 0.5, target_layer_number = -1)
|
112 |
visualization = inference_visualization(input_img, transparency = 0.5, target_layer_number = -1)
|
113 |
return confidence, visualization
|
|
|
88 |
inputs=[
|
89 |
gr.Radio(["Yes", "No"], label="View GradCAM images?"),
|
90 |
gr.Number(label="Number of GradCAM images to view", default=5, max=10),
|
91 |
+
# gr.Textbox(label="Layer name for GradCAM visualization", default="layer4", lines=1),
|
92 |
+
gr.Slider(-2, -1, value = -2, step=1, label="Which Layer?"),
|
93 |
gr.Slider(minimum=0.1, maximum=1.0, step=0.1, default=0.5, label="Opacity"),
|
94 |
gr.Radio(["Yes", "No"], label="View misclassified images?"),
|
95 |
gr.Number(label="Number of misclassified images to view", default=5, min=1, max=10),
|
|
|
97 |
gr.Button(label="Submit", type="boolean"),
|
98 |
# gr.Image(shape=(32, 32), label="Input Image"),
|
99 |
# gr.Slider(0, 1, value = 0.5, label="Opacity of GradCAM"),
|
100 |
+
|
101 |
|
102 |
],
|
103 |
outputs = [gr.Label(num_top_classes=3), gr.Image(shape=(32, 32), label="Output").style(width=128, height=128)],
|
|
|
108 |
# Callback function for the Gradio interface
|
109 |
def gradio_callback(view_gradcam, num_gradcam_images, layer_name, opacity,
|
110 |
view_misclassified, num_misclassified_images,
|
111 |
+
input_img,submit):
|
112 |
confidence = inference_confidences(input_img, transparency = 0.5, target_layer_number = -1)
|
113 |
visualization = inference_visualization(input_img, transparency = 0.5, target_layer_number = -1)
|
114 |
return confidence, visualization
|