nielsr HF staff commited on
Commit
df923d5
1 Parent(s): 0dedb40

Update README.md

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