nielsr HF staff commited on
Commit
e792872
1 Parent(s): 6900e2e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -4
README.md CHANGED
@@ -1,6 +1,5 @@
1
  ---
2
  license: apache-2.0
3
- tags:
4
  datasets:
5
  - imagenet
6
  ---
@@ -34,18 +33,18 @@ You can use the raw model for image classification. See the [model hub](https://
34
  Here is how to use this model in PyTorch:
35
 
36
  ```python
37
- from transformers import PerceiverFeatureExtractor, PerceiverForImageClassificationFourier
38
  import requests
39
  from PIL import Image
40
 
41
- feature_extractor = PerceiverFeatureExtractor.from_pretrained("deepmind/vision-perceiver-fourier")
42
  model = PerceiverForImageClassificationFourier.from_pretrained("deepmind/vision-perceiver-fourier")
43
 
44
  url = "http://images.cocodataset.org/val2017/000000039769.jpg"
45
  image = Image.open(requests.get(url, stream=True).raw)
46
 
47
  # prepare input
48
- inputs = feature_extractor(image, return_tensors="pt").pixel_values
49
  # forward pass
50
  outputs = model(inputs)
51
  logits = outputs.logits
 
1
  ---
2
  license: apache-2.0
 
3
  datasets:
4
  - imagenet
5
  ---
 
33
  Here is how to use this model in PyTorch:
34
 
35
  ```python
36
+ from transformers import PerceiverImageProcessor, PerceiverForImageClassificationFourier
37
  import requests
38
  from PIL import Image
39
 
40
+ processor = PerceiverImageProcessor.from_pretrained("deepmind/vision-perceiver-fourier")
41
  model = PerceiverForImageClassificationFourier.from_pretrained("deepmind/vision-perceiver-fourier")
42
 
43
  url = "http://images.cocodataset.org/val2017/000000039769.jpg"
44
  image = Image.open(requests.get(url, stream=True).raw)
45
 
46
  # prepare input
47
+ inputs = processor(image, return_tensors="pt").pixel_values
48
  # forward pass
49
  outputs = model(inputs)
50
  logits = outputs.logits