Practical overview
When it fits
Use Cvt when you need an implementation and experiment workflow for researching or running CvT computer-vision models, rather than a hosted image-classification service.
Who it is for
- Computer-vision researchers studying vision Transformer architectures
- Developers running image-classification training or evaluation experiments
- Teams comparing convolutional token embedding designs with standard Vision Transformers
Documented uses
- Train a CvT model with a repository-provided YAML experiment configuration.
- Test a pretrained CvT model by supplying its model-file path.
- Adjust documented training configuration values from the command line.
- Compare listed CvT model variants and ImageNet results when selecting an experiment.
Requirements & limits
The repository is public and licensed under MIT. The documented implementation uses Python, PyTorch, and TorchVision.
- PyTorch and TorchVision must be installed before the repository’s listed dependencies.
- The README identifies PyTorch 1.7.1 as the development and test version and says other versions are not fully tested.
- ImageNet experiments expect separate train and validation directories with class-named subfolders.
- Listed CvT variants differ in input resolution, parameter count, and compute requirements.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Prepare an ImageNet experiment environment
Set up the documented prerequisites and folder structure for an ImageNet CvT experiment.
Before you start
- Python environment with PyTorch and TorchVision installed
- Repository dependencies listed in requirements.txt
- ImageNet training and validation images organized in class-named folders
Steps
Install PyTorch and TorchVision following their official installation instructions.
From the repository, install its listed dependencies with the command below.
python -m pip install -r requirements.txt --user -qArrange ImageNet data under
DATASET/imagenet/trainandDATASET/imagenet/val, with a folder for each class in each split.
Expected outcome
The documented software prerequisites and ImageNet directory layout are prepared for a configured experiment.
Guide limitations
- The repository states that development and testing used PyTorch 1.7.1 and that other PyTorch versions are not fully tested.
- This guide covers preparation only; it does not run training or test a model.
Run a configured local training or testing job
Use a repository YAML experiment configuration with the documented local job script.
Before you start
- The repository and its dependencies are set up
- A dataset prepared for the selected experiment when training
- A pretrained model file when testing
- A YAML configuration under the experiments directory
Steps
Choose an experiment YAML file under
experiments.For local training, run the command below.
bash run.sh -g 8 -t train --cfg experiments/imagenet/cvt/cvt-13-224x224.yamlFor testing a pretrained model, run the command below, replacing the placeholder with the model-file path.
bash run.sh -t test --cfg experiments/imagenet/cvt/cvt-13-224x224.yaml TEST.MODEL_FILE ${PRETRAINED_MODLE_FILE}If needed, provide configuration overrides after the training command’s config path, as shown in the README’s
TRAIN.LR 0.1example.
Expected outcome
The repository’s local script is invoked for a configured training or testing job; training outputs are documented under `OUTPUT/{dataset}/{training config}` by default.
Guide limitations
- The training example requests eight GPUs; available hardware and suitable settings are the user’s responsibility.
- Testing requires a pretrained model file.
- The README documents commands but does not establish that they will work unchanged in every environment.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 October 2026
- Original website title
- microsoft/CvT · Official homepage title · retained in its source language

