Spaces:
Runtime error
Runtime error
update app.py
Browse files
app.py
CHANGED
@@ -60,15 +60,21 @@ def hello(DoYouWantToShowMisClassifiedImages, HowManyImages):
|
|
60 |
return None
|
61 |
misClass_demo = gr.Interface(
|
62 |
fn = hello,
|
63 |
-
inputs=[
|
|
|
64 |
outputs=['image'],
|
65 |
-
title="
|
66 |
-
description="If your answer to the question
|
67 |
)
|
68 |
|
69 |
|
70 |
############
|
71 |
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
def inference(DoYouWantToShowGradCAMMedImages, HowManyImages, WhichLayer, transparency):
|
74 |
if(DoYouWantToShowGradCAMMedImages.lower() == "yes"):
|
@@ -84,13 +90,13 @@ def inference(DoYouWantToShowGradCAMMedImages, HowManyImages, WhichLayer, transp
|
|
84 |
gradCAM_demo = gr.Interface(
|
85 |
fn=inference,
|
86 |
#DoYouWantToShowGradCAMMedImages, HowManyImages, WhichLayer, transparency
|
87 |
-
|
88 |
-
|
89 |
-
gr.Slider(
|
90 |
gr.Slider(0, 1, value = 0.7, label = "Overall Opacity of the Overlay")],
|
91 |
outputs=['image'],
|
92 |
-
title="
|
93 |
-
description="If your answer to the question
|
94 |
)
|
95 |
|
96 |
|
@@ -105,7 +111,16 @@ imageInputter_demo = gr.Interface(
|
|
105 |
"image","image","image","image","image","image","image","image","image","image"
|
106 |
],
|
107 |
[
|
108 |
-
"image","
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
],
|
110 |
examples=[
|
111 |
["bird.jpg", "car.jpg", "cat.jpg"],
|
|
|
60 |
return None
|
61 |
misClass_demo = gr.Interface(
|
62 |
fn = hello,
|
63 |
+
inputs=[ gr.Textbox(label="Do you want to show misClassified images ?", placeholder="Yes / yes / YES", lines=1),
|
64 |
+
gr.Slider(0, 20, step=5, label = "How many images ?")],
|
65 |
outputs=['image'],
|
66 |
+
title="Misclassified Images",
|
67 |
+
description="If your answer to the question is yes, then only it works !",
|
68 |
)
|
69 |
|
70 |
|
71 |
############
|
72 |
|
73 |
+
targets = None
|
74 |
+
device = torch.device("cpu")
|
75 |
+
classes = ('plane', 'car', 'bird', 'cat', 'deer',
|
76 |
+
'dog', 'frog', 'horse', 'ship', 'truck')
|
77 |
+
|
78 |
|
79 |
def inference(DoYouWantToShowGradCAMMedImages, HowManyImages, WhichLayer, transparency):
|
80 |
if(DoYouWantToShowGradCAMMedImages.lower() == "yes"):
|
|
|
90 |
gradCAM_demo = gr.Interface(
|
91 |
fn=inference,
|
92 |
#DoYouWantToShowGradCAMMedImages, HowManyImages, WhichLayer, transparency
|
93 |
+
inputs=[ gr.Textbox(label="Do you want to show GradCammed images ?", placeholder="Yes / yes / YES", lines=1),
|
94 |
+
gr.Slider(0, 20, step=5, label = "How many images ?"),
|
95 |
+
gr.Slider(-3, -1, value = -1, step=1, label = "Which layer ?"),
|
96 |
gr.Slider(0, 1, value = 0.7, label = "Overall Opacity of the Overlay")],
|
97 |
outputs=['image'],
|
98 |
+
title="GradCammed Images",
|
99 |
+
description="If your answer to the question is yes, then only it works !",
|
100 |
)
|
101 |
|
102 |
|
|
|
111 |
"image","image","image","image","image","image","image","image","image","image"
|
112 |
],
|
113 |
[
|
114 |
+
gr.Image("image", label = "output 1"),
|
115 |
+
gr.Image("image", label = "output 2"),
|
116 |
+
gr.Image("image", label = "output 3"),
|
117 |
+
gr.Image("image", label = "output 4"),
|
118 |
+
gr.Image("image", label = "output 5"),
|
119 |
+
gr.Image("image", label = "output 6"),
|
120 |
+
gr.Image("image", label = "output 7"),
|
121 |
+
gr.Image("image", label = "output 8"),
|
122 |
+
gr.Image("image", label = "output 9"),
|
123 |
+
gr.Image("image", label = "output 10")
|
124 |
],
|
125 |
examples=[
|
126 |
["bird.jpg", "car.jpg", "cat.jpg"],
|