altndrr commited on
Commit
8c523c7
1 Parent(s): ce179d5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -1
README.md CHANGED
@@ -39,7 +39,7 @@ outputs = model(images, alpha=0.7)
39
  labels, scores = outputs["vocabularies"][0], outputs["scores"][0]
40
 
41
  # print the top 5 most likely labels for the image
42
- values, indices = scores.sort(dim=-1, descending=True)
43
  print("\nTop predictions:\n")
44
  for value, index in zip(values, indices):
45
  print(f"{labels[index]:>16s}: {100 * value.item():.2f}%")
 
39
  labels, scores = outputs["vocabularies"][0], outputs["scores"][0]
40
 
41
  # print the top 5 most likely labels for the image
42
+ values, indices = scores.topk(3)
43
  print("\nTop predictions:\n")
44
  for value, index in zip(values, indices):
45
  print(f"{labels[index]:>16s}: {100 * value.item():.2f}%")