nielsr HF staff fcakyon commited on
Commit
c12281d
1 Parent(s): 5306795

fix a typo in code snippet (#3)

Browse files

- fix a typo in code snippet (4655a3825d3fd6bcdc6f862f92bae4c348ab3516)
- Update README.md (fa5f033feb1c19ba739ff3ebbd1447fe85ebf4b0)


Co-authored-by: Fatih <fcakyon@users.noreply.huggingface.co>

Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -20,16 +20,16 @@ You can use the raw model for video classification into one of the 174 possible
20
  Here is how to use this model to classify a video:
21
 
22
  ```python
23
- from transformers import TimesformerFeatureExtractor, TimesformerForVideoClassification
24
  import numpy as np
25
  import torch
26
 
27
  video = list(np.random.randn(8, 3, 224, 224))
28
 
29
- feature_extractor = TimesformerFeatureExtractor.from_pretrained("facebook/timesformer-base-finetuned-ssv2")
30
  model = TimesformerForVideoClassification.from_pretrained("facebook/timesformer-base-finetuned-ssv2")
31
 
32
- inputs = feature_extractor(video, return_tensors="pt")
33
 
34
  with torch.no_grad():
35
  outputs = model(**inputs)
 
20
  Here is how to use this model to classify a video:
21
 
22
  ```python
23
+ from transformers import AutoImageProcessor, TimesformerForVideoClassification
24
  import numpy as np
25
  import torch
26
 
27
  video = list(np.random.randn(8, 3, 224, 224))
28
 
29
+ processor = AutoImageProcessor.from_pretrained("facebook/timesformer-base-finetuned-ssv2")
30
  model = TimesformerForVideoClassification.from_pretrained("facebook/timesformer-base-finetuned-ssv2")
31
 
32
+ inputs = processor(images=video, return_tensors="pt")
33
 
34
  with torch.no_grad():
35
  outputs = model(**inputs)