Monodepth2 pins PyTorch 0.4.1, deletes your KITTI PNGs during conversion, and restricts the code to non-commercial use
[ICCV 2019] Monocular depth estimation from a single image
At a glance
- What is it?
- nianticlabs/monodepth2 is the reference PyTorch implementation of the ICCV 2019 paper on self-supervised monocular depth prediction. This article covers the pinned environment, the pretrained model table, the 175GB KITTI preparation and the license limit.
- Who is it for?
- Use Monodepth2 for research or study of self-supervised depth estimation, where a pretrained model and a single test_simple.py call give you a depth map quickly. Do not use it in a commercial product without reading the LICENSE file first, and plan for an old Python 3.6 and PyTorch 0.4.1 environment.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 24 days ago.
- What is it written in?
- Mainly Jupyter Notebook, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 26, 2026, and from our analysis. They are not legal advice.
Star history
- nianticlabs/monodepth24,511 ★ · +8
| Repository | 2026-10-08 | 2026-11-26 |
|---|---|---|
| nianticlabs/monodepth2 | 4.5k | 4.5k |
8 Stars in the last 49 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The setup commands pin PyTorch 0.4.1 and OpenCV 3.3.1, an environment from 2018
The dependency instructions assume a fresh Anaconda distribution and three lines:
conda install pytorch=0.4.1 torchvision=0.2.1 -c pytorch
pip install tensorboardX==1.4
conda install opencv=3.3.1 # just needed for evaluationThe authors ran their experiments with PyTorch 0.4.1, CUDA 9.1, Python 3.6.6 and Ubuntu 18.04. They also report training models successfully with PyTorch 1.0, and say the code is compatible with Python 2.7.
OpenCV is only needed for evaluation, so a prediction-only user can skip that line. The README warns that OpenCV 3.3.1 can be hard to install with Python 3.7 and recommends a virtual environment on Python 3.6.6: `conda create -n monodepth2 python=3.6.6 anaconda `.
The consequence is plain. A current Python and a current CUDA toolkit are outside what the instructions cover. Anyone on a modern GPU stack should expect to port the code or keep a separate old environment.
test_simple.py predicts scaled disparity, and only stereo-trained models give metric depth
The fastest check is one command on the bundled image:
python test_simple.py --image_path assets/test_image.jpg --model_name mono+stereo_640x192That predicts scaled disparity for a single image. If you use a stereo-trained model, adding `--pred_metric_depth` estimates metric depth instead:
python test_simple.py --image_path assets/test_image.jpg --model_name mono+stereo_640x192 --pred_metric_depthOn its first run, either command downloads the `mono+stereo_640x192` pretrained model, 99MB, into the `models/` folder. Nothing else needs fetching for a single prediction.
The distinction between disparity and metric depth is the practical limit. A mono-only model gives scaled disparity, which tells you relative depth ordering but not distance in metres. Metric output depends on stereo training, and the flag is documented for stereo-trained models only.
The repository also includes `depth_prediction_example.ipynb` at the top level, which is why GitHub lists Jupyter Notebook as the primary language even though the training code is Python scripts.
Pretraining on ImageNet cuts the KITTI absolute relative error more than doubling the resolution does
The README lists nine models under `--model_name`, each with its training modality, whether it is ImageNet pretrained, its input resolution, and two KITTI numbers: absolute relative error (lower is better) and delta < 1.25 (higher is better).
At 640 x 192, the pretrained models score 0.115 (`mono_640x192`), 0.109 (`stereo_640x192`) and 0.106 (`mono+stereo_640x192`) on absolute relative error. The same three without pretraining, `mono_no_pt_640x192`, `stereo_no_pt_640x192` and `mono+stereo_no_pt_640x192`, score 0.132, 0.130 and 0.127. Removing ImageNet pretraining costs between 0.017 and 0.021 in every pair.
Resolution changes less. `mono_1024x320` scores 0.115, the same as `mono_640x192`. `stereo_1024x320` is 0.107 against 0.109, and `mono+stereo_1024x320` is 0.106, equal to its smaller sibling. Delta < 1.25 moves from 0.877 to 0.879 for the mono pair.
So the larger models buy almost nothing on KITTI in this table, and the pretrained versions cost nothing extra to choose. Mono + Stereo at either resolution has the lowest error listed, 0.106.
The KITTI JPEG conversion command deletes the original PNG files
Training data comes from the raw KITTI dataset. The README downloads it with a file list shipped in the repository:
wget -i splits/kitti_archives_to_download.txt -P kitti_data/It then unzips from inside `kitti_data`. The warning on this step is blunt: the download weighs about 175GB, so make sure you have enough space to unzip too.
The default settings expect JPEG images, and the conversion command also removes the originals:
find kitti_data/ -name '*.png' | parallel 'convert -quality 92 -sampling-factor 2x2,1x1,1x1 {.}.png {.}.jpg && rm {}'The `rm {}` at the end deletes each raw KITTI `.png` after conversion. If you want the PNGs kept, skip this step and train from the raw files by adding `--png` when training, at the expense of slower load times.
The explicit `-sampling-factor 2x2,1x1,1x1` matters. The authors converted on Ubuntu 16.04 with that default chroma subsampling, and found that Ubuntu 18.04 defaults to `2x2,2x2,2x2`, which gives different results. The command pins the value so your images match the experiments. The dataset can live anywhere if you pass `--data_path` during training and evaluation.
Splits live in splits/, and the default trains on Zhou's subset of the Eigen split
The train, test and validation splits are defined in the `splits/` folder. By default, the code trains a depth model using Zhou's subset of the standard Eigen split of KITTI, linked to the SfMLearner repository.
Two other model families are mentioned beyond the main table. Models trained on the odometry split are available for the monocular and mono+stereo modalities. Resnet 50 depth models are offered both with ImageNet pretrained weights and trained from scratch, and the instruction is to set `--num_layers 50` when using them.
That flag is a trap if forgotten. The default network is not resnet 50, so loading a resnet 50 checkpoint without `--num_layers 50` will not match the architecture.
The code layout supports the training workflow. Top-level files include `train.py`, `trainer.py`, `options.py`, `evaluate_depth.py`, `evaluate_pose.py`, `export_gt_depth.py`, `kitti_utils.py`, `layers.py` and `utils.py`, plus `networks/`, `datasets/`, `experiments/` and `assets/` folders.
The license is for non-commercial use, and GitHub reports NOASSERTION for it
The README states that the code is for non-commercial use and points to the LICENSE file for terms. GitHub's license field for the repository reads NOASSERTION, which means the platform did not match the file to a standard license. For a reader, the practical result is that you cannot assume MIT or Apache style terms.
A team building a commercial product on this code needs to read the LICENSE file itself and, if the terms rule out the use, ask the authors. A research group can use it as the README describes, and cite the paper.
The citation is given as a BibTeX entry for the ICCV 2019 paper Digging into Self-Supervised Monocular Depth Estimation by Clement Godard, Oisin Mac Aodha, Michael Firman and Gabriel J. Brostow. The README links the arXiv PDF.
The pretrained weights are hosted on a Google Cloud Storage bucket under niantic-lon-static, and the README links each zip individually. Treat them as covered by the same non-commercial notice until you have checked.
The last push was 2026-10-05, but the documented environment is from 2018
nianticlabs/monodepth2 is not archived, and its last push was on 2026-11-02. The repository has no GitHub releases, so there is no version tag to pin. Whatever you clone from the master branch is the state of the code.
That push date says the repository was touched recently. It does not say the README's environment is current, since the setup instructions still describe PyTorch 0.4.1, CUDA 9.1 and Python 3.6.6. The setup section does not claim support for recent PyTorch.
The description line reads ICCV 2019, which fits a repository that exists mainly to accompany a paper. It is a reference implementation for training and testing depth estimation models using the method in that paper, not a packaged library with an installable API, and the file list contains no setup script.
The decision comes down to purpose. For reproducing the paper's numbers, the pinned versions and the explicit chroma subsampling are exactly what you want. For deploying depth estimation in a product, the license, the old stack and the lack of releases all work against it.
Editorial conclusion
Use Monodepth2 for research or study of self-supervised depth estimation, where a pretrained model and a single test_simple.py call give you a depth map quickly. Do not use it in a commercial product without reading the LICENSE file first, and plan for an old Python 3.6 and PyTorch 0.4.1 environment. Before training, check that you have room for the 175GB KITTI download plus its unzipped copy.
Frequently asked questions
Can I use Monodepth2 for commercial projects?
The README says the code is for non-commercial use and points to the LICENSE file for terms. GitHub reports the license as NOASSERTION, so read the file before relying on it.
How do I run Monodepth2 on a single image?
Run python test_simple.py --image_path assets/test_image.jpg --model_name mono+stereo_640x192. The first run downloads the 99MB pretrained model into the models/ folder.
How much disk space does Monodepth2 need for KITTI training data?
The raw KITTI download weighs about 175GB, and you need room to unzip it as well. The JPEG conversion command also deletes the raw .png files.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/nianticlabs-monodepth2)Star history chart for your README
[](https://hysenlabs.com/projects/nianticlabs-monodepth2)Was this useful?