nielsr HF staff commited on
Commit
a46a961
1 Parent(s): e457400

Update README

Browse files
Files changed (1) hide show
  1. README.md +2 -1
README.md CHANGED
@@ -45,7 +45,8 @@ inputs = feature_extractor(images=image, return_tensors="pt")
45
  outputs = model(**inputs)
46
  logits = outputs.logits
47
  # model predicts one of the 1000 ImageNet classes
48
- predicted_class = logits.argmax(-1).item()
 
49
  ```
50
 
51
  Currently, both the feature extractor and model support PyTorch. Tensorflow and JAX/FLAX are coming soon, and the API of ViTFeatureExtractor might change.
 
45
  outputs = model(**inputs)
46
  logits = outputs.logits
47
  # model predicts one of the 1000 ImageNet classes
48
+ predicted_class_idx = logits.argmax(-1).item()
49
+ print("Predicted class:", model.config.id2label[predicted_class_idx])
50
  ```
51
 
52
  Currently, both the feature extractor and model support PyTorch. Tensorflow and JAX/FLAX are coming soon, and the API of ViTFeatureExtractor might change.