From a46a961b1e48f4a10d875feb1c3909a67316bb57 Mon Sep 17 00:00:00 2001 From: Niels Rogge Date: Tue, 30 Mar 2021 18:14:02 +0000 Subject: [PATCH] Update README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4378930..993282b 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,8 @@ inputs = feature_extractor(images=image, return_tensors="pt") outputs = model(**inputs) logits = outputs.logits # model predicts one of the 1000 ImageNet classes -predicted_class = logits.argmax(-1).item() +predicted_class_idx = logits.argmax(-1).item() +print("Predicted class:", model.config.id2label[predicted_class_idx]) ``` Currently, both the feature extractor and model support PyTorch. Tensorflow and JAX/FLAX are coming soon, and the API of ViTFeatureExtractor might change.