Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Lean Geometry: LeJEPA pre-training for lightweight monocular depth

Does LeJEPA self-supervised pre-training on unlabelled frames of the target domains give a lightweight depth encoder better features than random initialisation, at zero inference cost? We answer it with a controlled comparison on three recent encoder-decoders (FlexDepth, ZipDepth, BoRe-Depth) plus METER from the course project, on NYU Depth V2 and KITTI.

Sapienza University of Rome, ALCOR Lab. Supervision: Claudio Schiavella and Prof. Irene Amerini. It continues Project 7 of the Computer Vision course ("Lean Geometry: Boosting Mobile MDE with LeJEPA").

Protocol in one paragraph

For every model: (1) the public weights are evaluated on the NYU and KITTI test sets as they are (FlexDepth on NYU is retrained by us); (2) the encoder is pre-trained once with LeJEPA in two variants, classic (official recipe) and dense (METER recipe), on unlabelled NYU raw and KITTI raw frames together, with balanced batches and the test scenes excluded; (3) the encoder is frozen and only the decoder is trained, separately on NYU and on KITTI, with the same procedure for three initialisations (random, LeJEPA classic, LeJEPA dense), 1 seed for now; an ablation repeats it with the encoder unfrozen (same learning rate as the decoder). Zero-shot evaluation on unseen datasets comes later. Only the architectures are kept: method-specific heuristics are dropped. Details: docs/protocol.md.

Repository layout

The top level follows the ALCOR thesis-repository structure (models/, data/, sota/, utils/, main.py).

main.py            single entry point: python main.py <command>
models/            METER (meter.py), common interface of every model (baselines.py), LeJEPA projectors
data/              data code only (views for LeJEPA, download scripts, split lists); data lives outside the repo
sota/              third-party code, never modified: baselines as pinned submodules, course reference files
utils/             device/precision policy, seeding, paths, result I/O
training/          LeJEPA objective (classic | dense), step-3 loss, trainer with resume
evaluation/        protocol metrics (crops, caps, median / scale-shift alignment)
configs/           recipes (configs/lejepa/classic.yaml, dense.yaml)
docker/            Dockerfile (cu118 for the lab GPUs, cu130 for an RTX 5070)
scripts/alcor/     build, run and clean up containers on the ALCOR machines
tests/             CPU tests (pytest)
results/           small final tables only; phase-1 results in results/phase1_meter/
docs/              protocol, how to work on the lab machines, references

Quick start

git clone --recurse-submodules https://github.com/MashaUP/Computer_Vision_Project.git
cd Computer_Vision_Project
# local (any machine with PyTorch): `pip install .` installs the dependencies only (code runs from the repo root)
pip install '.[test]' && python -m pytest -q && python main.py check

On the ALCOR machines everything runs in Podman: see docs/alcor.md.

Status

Detailed checklist: docs/experimental_plan.md.

Step State
Repository restructure, common model interface, protocol metrics, container and lab scripts done
LeJEPA classic / dense in one code path; phase-1 recipes reproduce the exam code exactly (scripts/verify_phase1_equivalence.py) done
One trainer for pre-training and frozen-encoder fine-tuning, with checkpoint + resume done (step-3 loss: photometric for FlexDepth/BoRe, ZipDepthLoss on Depth Anything V2 pseudo-depth for ZipDepth)
NYU complete download and labelled-frame extraction (data/download/nyu.py) done on the lab (24,863 raw train triplets)
FlexDepth on NYU, original trainer (scripts/train_flexdepth_nyu.py, lists from data.download.nyu triplets) done on the lab (50 epochs, weights/flexdepth_n_nyu/); test numbers in results/step2_public/
Public-weight loaders, strict (models/public_weights.py, main.py eval-public) done
Step-2 evaluation of the reference weights (results/step2_public/) done (28/11): FlexDepth NYU / KITTI, BoRe-Depth NYU / KITTI, ZipDepth NYU / KITTI
KITTI preparation (data/download/download_kitti.py --make_splits) done on the lab (28/11): 27,154 train triplets, 652 Eigen test pairs, leak-checked
Depth Anything V2 pseudo-depth for ZipDepth (scripts/make_pseudo_depth.py) done: NYU (28/11, 24,863 frames, 3.2 h on a 1080 Ti), KITTI (29/11, 27,154 frames, 13.1 h)
Joint balanced NYU + KITTI data for LeJEPA pre-training (dataset: joint) done (29/11), CPU-tested
LeJEPA pre-trainings (6, NYU + KITTI together), decoder trainings (18 frozen + 18 unfrozen ablation), 1 seed after the joint data
Zero-shot evaluation (SUN RGB-D, DIODE or Virtual KITTI 2) later
NYU raw depth alignment next

Running

python main.py pretrain --config configs/runs/example_pretrain.yaml          # LeJEPA classic | dense
python main.py finetune --config configs/runs/example_finetune.yaml          # frozen encoder, decoder only
python main.py evaluate --config configs/runs/example_finetune.yaml --test-list splits/nyu_labeled_test.txt

Every run writes to <runs root>/<name>/ (config.yaml, metrics.csv, last.ckpt) and resumes by itself when the same command is run again.

Phase 1 (course project)

The exam version (two METER setups, "classic" at the root and "experimental" dense, with notebooks, checkpoints and outputs, with full history) is the original repository https://github.com/Zunza5/lejepa-monocular-depth-estimation. Its results are in results/phase1_meter/; METER itself lives on in models/meter.py.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages