Vvaann commited on
Commit
e5c1737
·
verified ·
1 Parent(s): 7410c0d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -41,6 +41,7 @@ def inference(input_img, transparancy = 0.5, target_layer_number = -1):
41
  input_img = transform(input_img)
42
  input_img = input_img.unsqueeze(0)
43
  outputs = model(input_img)
 
44
  softmax = torch.nn.Softmax(dim=0)
45
  o = softmax(outputs.flattern())
46
  confidences = {classes[i]:float(o[i] for i in range(10))}
@@ -61,7 +62,7 @@ demo = gr.Inference(
61
  gr.Slider(0,1,value=0.5,label="Overall opacity of the overelay"),
62
  gr.Slider(-2,-1, value =-2, step=1, label= "Which layer for Gradcam")
63
  ],
64
- outputd = [
65
  "text",
66
  gr.IMage(width= 256, height=256,label="Output"),
67
  gr.Label(num_top_classes=3)
 
41
  input_img = transform(input_img)
42
  input_img = input_img.unsqueeze(0)
43
  outputs = model(input_img)
44
+ print(outputs)
45
  softmax = torch.nn.Softmax(dim=0)
46
  o = softmax(outputs.flattern())
47
  confidences = {classes[i]:float(o[i] for i in range(10))}
 
62
  gr.Slider(0,1,value=0.5,label="Overall opacity of the overelay"),
63
  gr.Slider(-2,-1, value =-2, step=1, label= "Which layer for Gradcam")
64
  ],
65
+ outputs = [
66
  "text",
67
  gr.IMage(width= 256, height=256,label="Output"),
68
  gr.Label(num_top_classes=3)