Video Classification
Transformers
Safetensors
ttvidt
feature-extraction
video
video-representation-learning
self-supervised-learning
motion
temporal-modeling
dinov3
vision-transformer
custom_code
Eval Results (legacy)
Instructions to use KBlueLeaf/TTVidT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KBlueLeaf/TTVidT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("video-classification", model="KBlueLeaf/TTVidT", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("KBlueLeaf/TTVidT", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 791 Bytes
742c169 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import importlib
import torch
from . import env
from .env import TORCH_COMPILE as _ # noqa: F401 (bundles env.py)
def import_class(cls_string):
if not isinstance(cls_string, str):
return cls_string
module, cls = cls_string.rsplit(".", 1)
module = importlib.import_module(module)
return getattr(module, cls)
def compile_wrapper(func):
"""Decorator: compile the function once with torch.compile when TORCH_COMPILE=True."""
_compiled = None
def wrapper(*args, **kwargs):
nonlocal _compiled
if env.TORCH_COMPILE:
if _compiled is None:
_compiled = torch.compile(func, **env.COMPILE_KWARG)
return _compiled(*args, **kwargs)
else:
return func(*args, **kwargs)
return wrapper
|