raja5259 commited on
Commit
735e1d8
·
verified ·
1 Parent(s): 381c7f9

update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -9
app.py CHANGED
@@ -60,15 +60,21 @@ def hello(DoYouWantToShowMisClassifiedImages, HowManyImages):
60
  return None
61
  misClass_demo = gr.Interface(
62
  fn = hello,
63
- inputs=['text', gr.Slider(0, 20, step=5)],
 
64
  outputs=['image'],
65
- title="Misclasseified Images",
66
- description="If your answer to the question DoYouWantToShowMisClassifiedImages is yes, then only it works.",
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
- inputs=[ gr.Textbox(label="Do You Want To Show GradCAMMed Images ?", info="Initial text", lines=1),
89
- gr.Slider(0, 20, step=5), gr.Slider(-3, -1, value = -1, step=1),
90
  gr.Slider(0, 1, value = 0.7, label = "Overall Opacity of the Overlay")],
91
  outputs=['image'],
92
- title="GradCammd Images",
93
- description="If your answer to the question DoYouWantToShowGradCAMMedImages is yes, then only it works.",
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","image","image","image","image","image","image","image","image","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"],