fix code snippet in model card (#3)
Browse files- fix code snippet in model card (18f67186e115131c4df8d89788d8d3356da506aa)
- Update README.md (595e15554a3c0eafb01c367e9ef0016658f7655a)
Co-authored-by: Fatih <[email protected]>
README.md
CHANGED
@@ -20,16 +20,16 @@ You can use the raw model for video classification into one of the 600 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(8, 3, 224, 224))
|
28 |
|
29 |
-
|
30 |
model = TimesformerForVideoClassification.from_pretrained("facebook/timesformer-base-finetuned-k600")
|
31 |
|
32 |
-
inputs =
|
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-k600")
|
30 |
model = TimesformerForVideoClassification.from_pretrained("facebook/timesformer-base-finetuned-k600")
|
31 |
|
32 |
+
inputs = processor(images=video, return_tensors="pt")
|
33 |
|
34 |
with torch.no_grad():
|
35 |
outputs = model(**inputs)
|