Practical overview
When it fits
Use STEGO when exploring or researching semantic image segmentation without dense labeled examples, or when reproducing the repository's pretrained evaluation and training workflows.
Who it is for
- Computer-vision researchers studying unsupervised semantic segmentation.
- Practitioners exploring semantic region discovery when pixel-level labels are unavailable.
- Developers benchmarking feature-correspondence distillation on image datasets.
Documented uses
- Evaluate provided pretrained segmentation models.
- Train STEGO from scratch on the repository's supported dataset workflow.
- Prepare a custom image dataset for training, with or without labels.
- Inspect training progress with TensorBoard.
Requirements & limits
The repository is public and specifies an MIT license. The documented local workflow uses Conda and PyTorch; the README also links to a Colab demo notebook.
- Training from scratch requires cropped dataset preparation and KNN-index precomputation.
- Custom datasets must follow the documented image-directory structure and have the object-type count set in the training configuration.
- The repository provides separate configuration files for evaluation parameters and training hyperparameters.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Prepare a custom dataset for STEGO training
Configure a custom image dataset and generate the prerequisite KNN information before starting model training.
Before you start
- A local copy of the STEGO repository and its Conda environment.
- A dataset directory under the PyTorch data root with imgs/train and imgs/val directories.
- The number of object types to find.
Steps
Create the dataset directory and place training and validation images in imgs/train and imgs/val.
Include labels/train and labels/val only if labels are available; the README says to omit the labels directory when they are not.
Set dataset_name to "directory", dir_dataset_name to the dataset directory name, and dir_dataset_n_classes to the number of object types in train_config.yml.
Uncomment the custom-dataset code and run python precompute_knns.py from STEGO/src.
Run python train_segmentation.py from STEGO/src to train on the custom dataset.
Expected outcome
The repository is configured to train STEGO on the custom dataset after its KNN information is generated.
Guide limitations
- The README says cropping can be used to increase spatial resolution and directs users to the cropping utility.
- This recipe follows the repository instructions; it does not establish that a particular dataset or environment will run successfully.
Evaluate a provided pretrained STEGO model
Prepare the repository's documented pretrained-model and dataset assets for evaluation.
Before you start
- Conda installed.
- A local copy of the STEGO repository.
Steps
Create and activate the environment with conda env create -f environment.yml and conda activate stego.
From the repository's src directory, run python download_models.py.
Set pytorch_data_dir to the system's PyTorch data directory, then run python download_datasets.py.
Unzip the downloaded dataset archives in the PyTorch data directory.
From STEGO/src, run python eval_segmentation.py; adjust the model or evaluation parameters in configs/eval_config.yml if needed.
Expected outcome
The documented evaluation workflow is prepared to assess a pretrained STEGO model on the downloaded datasets.
Guide limitations
- The README names the COCO-Stuff, Cityscapes, Potsdam, and Potsdamraw archives.
- This recipe reflects repository instructions and is not a compatibility or successful-execution guarantee.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 October 2026
- Original website title
- mhamilton723/STEGO · Official homepage title · retained in its source language

