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

Update README

Browse files
Files changed (1) hide show
  1. README.md +1 -1
README.md CHANGED
@@ -41,7 +41,7 @@ url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
41
  image = Image.open(requests.get(url, stream=True).raw)
42
  feature_extractor = ViTFeatureExtractor.from_pretrained('google/vit-base-patch16-224')
43
  model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224')
44
- inputs = feature_extractor(images=image)
45
  outputs = model(**inputs)
46
  logits = outputs.logits
47
  # model predicts one of the 1000 ImageNet classes
 
41
  image = Image.open(requests.get(url, stream=True).raw)
42
  feature_extractor = ViTFeatureExtractor.from_pretrained('google/vit-base-patch16-224')
43
  model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224')
44
+ 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