fix code snippet in model card (#3)
- fix code snippet in model card (18f67186e115131c4df8d89788d8d3356da506aa) - Update README.md (595e15554a3c0eafb01c367e9ef0016658f7655a) Co-authored-by: Fatih <fcakyon@users.noreply.huggingface.co>
This commit is contained in:
parent
3da1913755
commit
df9bcb190c
|
@ -20,16 +20,16 @@ You can use the raw model for video classification into one of the 600 possible
|
|||
Here is how to use this model to classify a video:
|
||||
|
||||
```python
|
||||
from transformers import TimesformerFeatureExtractor, TimesformerForVideoClassification
|
||||
from transformers import AutoImageProcessor, TimesformerForVideoClassification
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
video = list(np.random.randn(8, 3, 224, 224))
|
||||
|
||||
feature_extractor = TimesformerFeatureExtractor.from_pretrained("facebook/timesformer-base-finetuned-k600")
|
||||
processor = AutoImageProcessor.from_pretrained("facebook/timesformer-base-finetuned-k600")
|
||||
model = TimesformerForVideoClassification.from_pretrained("facebook/timesformer-base-finetuned-k600")
|
||||
|
||||
inputs = feature_extractor(video, return_tensors="pt")
|
||||
inputs = processor(images=video, return_tensors="pt")
|
||||
|
||||
with torch.no_grad():
|
||||
outputs = model(**inputs)
|
||||
|
|
Loading…
Reference in New Issue