MadhurGarg commited on
Commit
d1ff39a
·
1 Parent(s): 3751a7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -52,11 +52,11 @@ def image_classifier(input_image, top_classes=3, show_cam=True, target_layers=[2
52
  o = softmax(output.flatten())
53
 
54
  confidences = {classes[i]: float(o[i]) for i in range(10)}
55
- #_, prediction = torch.max(outputs, 1)
56
 
57
  #confidences.sort(key=lambda x: x[1], reverse=True)
58
  #confidences = OrderedDict(confidences[:top_classes])
59
- label = torch.argmax(output).item()
60
 
61
  outputs = list()
62
  if show_cam:
 
52
  o = softmax(output.flatten())
53
 
54
  confidences = {classes[i]: float(o[i]) for i in range(10)}
55
+ _, label = torch.max(output, 1)
56
 
57
  #confidences.sort(key=lambda x: x[1], reverse=True)
58
  #confidences = OrderedDict(confidences[:top_classes])
59
+ #label = torch.argmax(output).item()
60
 
61
  outputs = list()
62
  if show_cam: