Spaces:
Runtime error
Runtime error
Create model.py
Browse files
model.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import VideoMAEForVideoClassification, VideoMAEImageProcessor
|
| 2 |
+
from huggingface_hub import login
|
| 3 |
+
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
login(os.getenv("HF_TOKEN"))
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
model_name = "OPear/videomae-large-finetuned-UCF-Crime"
|
| 11 |
+
|
| 12 |
+
# Load processor and model
|
| 13 |
+
processor = VideoMAEImageProcessor.from_pretrained(model_name)
|
| 14 |
+
model = VideoMAEForVideoClassification.from_pretrained(model_name)
|