lucidrains/vit-pytorch
Implementation of Vision Transformer, a simple way to achieve SOTA in vision classification with only a single transformer encoder, in Pytorch
What it solves
This project provides a collection of PyTorch implementations for Vision Transformers (ViT) and their many variants. It simplifies the process of experimenting with state-of-the-art computer vision architectures that use transformer encoders for image classification and feature processing.
How it works
The library offers modular, ready-to-use implementations of various ViT architectures. Users can import specific models (like ViT, SimpleViT, or NaViT) and configure them via parameters such as image size, patch size, depth, and attention heads. The code handles the underlying tensor transformations, allowing users to pass image tensors directly into the model to receive classification predictions.
Who it’s for
It is designed for researchers and machine learning engineers who want to quickly implement, test, or compare different Vision Transformer architectures without writing the boilerplate code for each model from scratch.
Highlights
- Includes the original Vision Transformer implementation.
- Supports advanced variants like NaViT (for variable-resolution images), DeepViT, CaiT, and many others.
- Provides utilities for model distillation to create efficient student models from larger teachers.
- Offers flexible configuration for patch sizes, embedding dimensions, and attention mechanisms.
- Compatible with standard PyTorch workflows for training and inference.
Related
- Project
facebookresearch/pytorchvideoPyTorchVideo is a PyTorch‑based library that supplies video‑focused data loaders, transforms, and a zoo of pretrained models (e.g., SlowFast, X3D, MViT) for research and development of video understanding AI. It streamlines training and fast inference, supports mobile deployment, and is open‑source under Apache 2.0.
- Project
hiddenstateresearch/visualtorchVisualTorch is a Python library that visualizes PyTorch neural‑network architectures. It traces a real forward pass and can render the model as flow‑style, graph‑style, or LeNet‑style diagrams, optionally exporting animated GIFs that reveal layers step‑by‑step. Install via `pip install visualtorch` (or with the `[mcp]` extra for a generic stdio server). The tool is MIT‑licensed, documented, and cited in research papers.
- Project
lucidrains/x-transformersA modular PyTorch framework for building and experimenting with Transformer architectures, featuring easy-to-enable implementations of state-of-the-art research optimizations.
- Project
JingyunLiang/VRTVRT is a PyTorch implementation of the Video Restoration Transformer, a transformer‑based model that handles video super‑resolution, deblurring, denoising, frame interpolation and space‑time SR. It uses Temporal Mutual Self‑Attention and parallel warping to capture long‑range temporal dependencies, delivering state‑of‑the‑art PSNR gains on nine benchmarks. The repo includes pretrained weights, test scripts, a Colab demo, and instructions for training on standard video datasets.
- Project
pytorch/pytorchPyTorch is a Python-based library for deep learning and scientific computing that provides GPU-accelerated tensor operations and a flexible, dynamic system for building neural networks.