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
Download utils.py from KBlueLeaf/TTVidT: direct link, hf CLI and curl.
- Browser
- Download file 791 Bytes
-
https://huggingface.co/KBlueLeaf/TTVidT/resolve/main/utils.py
- Command line
-
hf download hf://KBlueLeaf/TTVidT/utils.py
-
curl -L -o utils.py https://huggingface.co/KBlueLeaf/TTVidT/resolve/main/utils.py
791 Bytes
| 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 | |