Update README.md
This commit is contained in:
parent
0c5eb2c860
commit
b5dfd1b518
|
@ -20,13 +20,13 @@ You can use the raw model for video classification into one of the 400 possible
|
||||||
Here is how to use this model to classify a video:
|
Here is how to use this model to classify a video:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from transformers import VideoMAEFeatureExtractor, TimesformerForVideoClassification
|
from transformers import AutoImageProcessor, TimesformerForVideoClassification
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
video = list(np.random.randn(8, 3, 224, 224))
|
video = list(np.random.randn(8, 3, 224, 224))
|
||||||
|
|
||||||
feature_extractor = VideoMAEFeatureExtractor.from_pretrained("MCG-NJU/videomae-base-finetuned-kinetics")
|
feature_extractor = AutoImageProcessor.from_pretrained("MCG-NJU/videomae-base-finetuned-kinetics")
|
||||||
model = TimesformerForVideoClassification.from_pretrained("facebook/timesformer-base-finetuned-k400")
|
model = TimesformerForVideoClassification.from_pretrained("facebook/timesformer-base-finetuned-k400")
|
||||||
|
|
||||||
inputs = feature_extractor(video, return_tensors="pt")
|
inputs = feature_extractor(video, return_tensors="pt")
|
||||||
|
|
Loading…
Reference in New Issue