Update README.md
Browse files
README.md
CHANGED
@@ -28,16 +28,16 @@ You can use the raw model for video classification into one of the 400 possible
|
|
28 |
Here is how to use this model to classify a video:
|
29 |
|
30 |
```python
|
31 |
-
from transformers import
|
32 |
import numpy as np
|
33 |
import torch
|
34 |
|
35 |
video = list(np.random.randn(16, 3, 224, 224))
|
36 |
|
37 |
-
|
38 |
model = VideoMAEForVideoClassification.from_pretrained("sandstorm12/videomae-small-finetuned-kinetics")
|
39 |
|
40 |
-
inputs =
|
41 |
|
42 |
with torch.no_grad():
|
43 |
outputs = model(**inputs)
|
|
|
28 |
Here is how to use this model to classify a video:
|
29 |
|
30 |
```python
|
31 |
+
from transformers import VideoMAEImageProcessor, VideoMAEForVideoClassification
|
32 |
import numpy as np
|
33 |
import torch
|
34 |
|
35 |
video = list(np.random.randn(16, 3, 224, 224))
|
36 |
|
37 |
+
processor = VideoMAEImageProcessor.from_pretrained("sandstorm12/videomae-small-finetuned-kinetics")
|
38 |
model = VideoMAEForVideoClassification.from_pretrained("sandstorm12/videomae-small-finetuned-kinetics")
|
39 |
|
40 |
+
inputs = processor(video, return_tensors="pt")
|
41 |
|
42 |
with torch.no_grad():
|
43 |
outputs = model(**inputs)
|