nielsr HF staff commited on
Commit
a046eb0
1 Parent(s): e83ff3d

Update README.md

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