fix a typo in code snippet (#2)
Browse files- fix a typo in code snippet (3753aeee87a9b3b11c8e4fcff74f0c824a4cafed)
- Update README.md (048d3c90f3f8c5343255801578a89ee6e1caad71)
Co-authored-by: Fatih <fcakyon@users.noreply.huggingface.co>
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
|
24 |
import numpy as np
|
25 |
import torch
|
26 |
|
27 |
video = list(np.random.randn(16, 3, 448, 448))
|
28 |
|
29 |
-
|
30 |
-
model = TimesformerForVideoClassification.from_pretrained("facebook/timesformer-hr-finetuned-
|
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(16, 3, 448, 448))
|
28 |
|
29 |
+
processor = AutoImageProcessor.from_pretrained("facebook/timesformer-hr-finetuned-ssv2")
|
30 |
+
model = TimesformerForVideoClassification.from_pretrained("facebook/timesformer-hr-finetuned-ssv2")
|
31 |
|
32 |
+
inputs = feature_extractor(images=video, return_tensors="pt")
|
33 |
|
34 |
with torch.no_grad():
|
35 |
outputs = model(**inputs)
|