nielsr HF staff commited on
Commit
e8f8d20
1 Parent(s): f5104f6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -31,17 +31,17 @@ fine-tuned versions on a task that interests you.
31
  Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
32
 
33
  ```python
34
- from transformers import AutoFeatureExtractor, ResNetForImageClassification
35
  import torch
36
  from datasets import load_dataset
37
 
38
  dataset = load_dataset("huggingface/cats-image")
39
  image = dataset["test"]["image"][0]
40
 
41
- feature_extractor = AutoFeatureExtractor.from_pretrained("microsoft/resnet-50")
42
  model = ResNetForImageClassification.from_pretrained("microsoft/resnet-50")
43
 
44
- inputs = feature_extractor(image, return_tensors="pt")
45
 
46
  with torch.no_grad():
47
  logits = model(**inputs).logits
 
31
  Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
32
 
33
  ```python
34
+ from transformers import AutoImageProcessor, ResNetForImageClassification
35
  import torch
36
  from datasets import load_dataset
37
 
38
  dataset = load_dataset("huggingface/cats-image")
39
  image = dataset["test"]["image"][0]
40
 
41
+ processor = AutoImageProcessor.from_pretrained("microsoft/resnet-50")
42
  model = ResNetForImageClassification.from_pretrained("microsoft/resnet-50")
43
 
44
+ inputs = processor(image, return_tensors="pt")
45
 
46
  with torch.no_grad():
47
  logits = model(**inputs).logits