zergswim commited on
Commit
11f8eb1
·
1 Parent(s): 26e56f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -15,7 +15,7 @@ def segment(image):
15
  with torch.no_grad():
16
  logits = model(**inputs).logits
17
  probs = torch.nn.Softmax(dim=1)(logits)
18
- labels = [(prob, model.config.id2label[idx]) for idx, prob in enumerate(probs)]
19
  print(labels)
20
 
21
  # model predicts one of the 1000 ImageNet classes
 
15
  with torch.no_grad():
16
  logits = model(**inputs).logits
17
  probs = torch.nn.Softmax(dim=1)(logits)
18
+ labels = [prob, model.config.id2label[idx] for idx, prob in enumerate(probs)]
19
  print(labels)
20
 
21
  # model predicts one of the 1000 ImageNet classes