PyTorch implementation of NaViT for processing images of arbitrary aspect ratios and resolutions.
Process images and video frames of any aspect ratio without cropping or distorting original inputs.
NaViT is a PyTorch library implementing Google's Patch n' Pack Vision Transformer architecture. It allows computer vision engineers and video AI developers to feed images of varying resolutions and aspect ratios into a single Vision Transformer model. You should use it if you want to train or evaluate multi-resolution vision backbones without forced cropping or padding.
This repository provides the core PyTorch class for NaViT, enabling variable-resolution image sequence packing. You can pass batches containing images of completely different dimensions directly into the forward pass. The underlying attention mechanism handles varying token counts across packed sequences.
It suits computer vision research engineers and machine learning developers building multimodal or video processing pipelines. It is not suitable for video editors looking for a desktop software application or pre-packaged editing tool.
Packs patches from images with different resolutions and aspect ratios into single token sequences.
Processes arbitrary image dimensions natively without forcing uniform padding or aspect ratio warping.
Allows customization of embedding dimension, head counts, MLP width, and token dropout probabilities.
NaViT is free under the MIT licence. Your only cost is the GPU compute infrastructure required to train and run your PyTorch models.
880 open remote AI-training roles, updated November 16, 2026; most pay $20–$175 an hour. Zekai lists them free; the application goes to the employer’s platform.
No, this is a code implementation of the model architecture. You must train the model on your own compute infrastructure.
Yes, NaViT packs patches from images of varying resolutions into sequence batches for efficient model training.
See Zekai first in Google