nielsr HF staff commited on
Commit
23f8b03
1 Parent(s): 48a4c1a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -35,16 +35,16 @@ You can use the raw model for encoding document images into a vector space, but
35
  Here is how to use this model in PyTorch:
36
 
37
  ```python
38
- from transformers import AutoFeatureExtractor, AutoModelForImageClassification
39
  import torch
40
  from PIL import Image
41
 
42
  image = Image.open('path_to_your_document_image').convert('RGB')
43
 
44
- feature_extractor = AutoFeatureExtractor.from_pretrained("microsoft/dit-base-finetuned-rvlcdip")
45
  model = AutoModelForImageClassification.from_pretrained("microsoft/dit-base-finetuned-rvlcdip")
46
 
47
- inputs = feature_extractor(images=image, return_tensors="pt")
48
  outputs = model(**inputs)
49
  logits = outputs.logits
50
 
 
35
  Here is how to use this model in PyTorch:
36
 
37
  ```python
38
+ from transformers import AutoImageProcessor, AutoModelForImageClassification
39
  import torch
40
  from PIL import Image
41
 
42
  image = Image.open('path_to_your_document_image').convert('RGB')
43
 
44
+ processor = AutoImageProcessor.from_pretrained("microsoft/dit-base-finetuned-rvlcdip")
45
  model = AutoModelForImageClassification.from_pretrained("microsoft/dit-base-finetuned-rvlcdip")
46
 
47
+ inputs = processor(images=image, return_tensors="pt")
48
  outputs = model(**inputs)
49
  logits = outputs.logits
50