[ICML'26] PointDiT: Pixel-Space Diffusion for Monocular Geometry Estimation
Python
update model weights
haofeixu02ca7e055baa
diff --git a/MODELS.md b/MODELS.mdindex 0f53a25..fd79b03 100644--- a/MODELS.md+++ b/MODELS.md@@ -1,22 +1,68 @@# Model Zoo-Six checkpoints: each of PointDiT-B / L / H at 256x256 and 512x512 resolutions.+- We provide six pre-trained PointDiT models: PointDiT-B / L / H, each at `256x256` (Stage 1) and `512x512` (Stage 2). All weights are hosted on [Hugging Face](https://huggingface.co/haofeixu/pointdit).-[Download the weights (Google Drive)](https://drive.google.com/drive/folders/1ctCGxi-WN1P5GpiteK41SXwLgQ1z5fEc?usp=drive_link) and symlink (or move) them under `pretrained/`:+- We assume that the downloaded weights are stored in the `pretrained` directory. It's recommended to create a symbolic link from `YOUR_MODEL_PATH` to `pretrained` using+```+ln -s YOUR_MODEL_PATH pretrained+```++- To verify the integrity of downloaded files, each model on this page includes its [sha256sum](https://sha256sum.com/) prefix in the file name, which can be checked using the command `sha256sum filename`.++- The `-nodinov3-` in every file name means the frozen DINOv3 encoder has been removed from the checkpoint: those weights are gated and cannot be redistributed here. They are downloaded once, separately, and re-attached at load time. See [DINOv3 encoder](#dinov3-encoder) below.+++## PointDiT++- Stage 1 pre-trains at `256x256` on SceneNet-RGBD. Stage 2 fine-tunes that model at `512x512` on `mixdata`, an 11-dataset synthetic mixture ([dataloader/configs/res512mix.yaml](dataloader/configs/res512mix.yaml)).++- The header comment of each `scripts/eval_*.sh` lists the zero-shot numbers the corresponding model reproduces.++| Model | Stage | Training Data | Training Resolution | DINOv3 Encoder | Download |+| -------------------------------------------- | :---: | :---------------------: | :--------------------: | :------------: | :------------------------------------------------------------------------------------------------------------: |+| pointditb-256-scenenet-nodinov3-58f0b231.pth | 1 | scenenet | 256x256 | ViT-B/16 | [download](https://huggingface.co/haofeixu/pointdit/resolve/main/pointditb-256-scenenet-nodinov3-58f0b231.pth) |+| pointditl-256-scenenet-nodinov3-00141e97.pth | 1 | scenenet | 256x256 | ViT-L/16 | [download](https://huggingface.co/haofeixu/pointdit/resolve/main/pointditl-256-scenenet-nodinov3-00141e97.pth) |+| pointdith-256-scenenet-nodinov3-9dddf3fc.pth | 1 | scenenet | 256x256 | ViT-H+/16 | [download](https://huggingface.co/haofeixu/pointdit/resolve/main/pointdith-256-scenenet-nodinov3-9dddf3fc.pth) |+| pointditb-512-mixdata-nodinov3-1d42aacf.pth | 2 | scenenet → mixdata | 256x256 → 512x512 | ViT-B/16 | [download](https://huggingface.co/haofeixu/pointdit/resolve/main/pointditb-512-mixdata-nodinov3-1d42aacf.pth) |+| pointditl-512-mixdata-nodinov3-240c1a4f.pth | 2 | scenenet → mixdata | 256x256 → 512x512 | ViT-L/16 | [download](https://huggingface.co/haofeixu/pointdit/resolve/main/pointditl-512-mixdata-nodinov3-240c1a4f.pth) |+| pointdith-512-mixdata-nodinov3-cb01dd3b.pth | 2 | scenenet → mixdata | 256x256 → 512x512 | ViT-H+/16 | [download](https://huggingface.co/haofeixu/pointdit/resolve/main/pointdith-512-mixdata-nodinov3-cb01dd3b.pth) |++The launch scripts in [scripts/](scripts) expect these files directly in `pretrained/`, under+exactly these names. They can also be fetched with the Hugging Face CLI:```bash-ln -s YOUR_MODEL_PATH pretrained+pip install -U "huggingface_hub[cli]"++# one model+hf download haofeixu/pointdit pointditl-512-mixdata-nodinov3-240c1a4f.pth --local-dir pretrained++# or all six (25 GB)+hf download haofeixu/pointdit --local-dir pretrained```-The launch scripts expect the checkpoints directly in `pretrained/`, under these exact-filenames:++## DINOv3 encoder++PointDiT conditions on a frozen DINOv3 encoder. Those weights are gated and cannot be+redistributed here, so they are not part of the checkpoints above and have to be downloaded+separately, once per model size.++Request access on the [official DINOv3 repository](https://github.com/facebookresearch/dinov3)+and place the weights in `pretrained/dinov3/`, under their exact upstream filenames:```-pretrained/-├── pointditb-256-scenenet.pth # PointDiT-B, 256, Stage 1-├── pointditl-256-scenenet.pth # PointDiT-L, 256, Stage 1-├── pointdith-256-scenenet.pth # PointDiT-H, 256, Stage 1-├── pointditb-512.pth # PointDiT-B, 512, Stage 2-├── pointditl-512.pth # PointDiT-L, 512, Stage 2-└── pointdith-512.pth # PointDiT-H, 512, Stage 2+pretrained/dinov3/+├── dinov3_vitb16_pretrain_lvd1689m-73cec8be.pth # PointDiT-B+├── dinov3_vitl16_pretrain_lvd1689m-8aa4cbdd.pth # PointDiT-L+└── dinov3_vith16plus_pretrain_lvd1689m-7c1da9a5.pth # PointDiT-H```++If they live somewhere else, point `DINOV3_WEIGHTS_DIR` at that directory instead:++```bash+export DINOV3_WEIGHTS_DIR=/path/to/dinov3+```++Every launch script in [scripts/](scripts) reads that variable and falls back to+`pretrained/dinov3`. A run that finds a checkpoint but no encoder to pair it with stops with an+error rather than conditioning on a randomly initialised encoder.diff --git a/README.md b/README.mdindex 23aac17..90e8717 100644--- a/README.md+++ b/README.md@@ -60,15 +60,18 @@ All commands are run from the repository root, and the launch scripts in [scriptbash run.sh # CPU-only smoke test: no GPU, checkpoint or dataset needed```-The DINOv3 weights are gated and needed only for training; the released checkpoints already-carry the encoder. To train, request access on the+The DINOv3 weights are gated and cannot be redistributed, so they are not part of the released+checkpoints. Request access on the[official DINOv3 repository](https://github.com/facebookresearch/dinov3) and place the weights-under `pretrained/dinov3/` with their exact upstream filenames.+under `pretrained/dinov3/` with their exact upstream filenames, or point `DINOV3_WEIGHTS_DIR` at+the directory holding them. They are needed for evaluation and the demo as well as for training;+see [MODELS.md](MODELS.md) for the file list.## Model ZooPre-trained models are available in the [Model Zoo](MODELS.md), at `256×256` and `512×512` for-each of PointDiT-B / L / H.+each of PointDiT-B / L / H. All weights are hosted on+[Hugging Face](https://huggingface.co/haofeixu/pointdit).Download the weights and place (or symlink) them in the `pretrained` directory:@@ -76,6 +79,9 @@ Download the weights and place (or symlink) them in the `pretrained` directory:ln -s YOUR_MODEL_PATH pretrained```+The checkpoints ship without the frozen DINOv3 encoder, which is downloaded separately (see+[Installation](#installation)).+## DemoCheck [scripts/demo_l_512.sh](scripts/demo_l_512.sh) for running our pre-trained models on your own images, with no ground truth and no camera intrinsics required. Set `IMAGE_DIR` at the top of the script and run it:diff --git a/main.py b/main.pyindex 8c3540e..229bb98 100644--- a/main.py+++ b/main.py@@ -685,6 +685,7 @@ def main(args):accelerator.wait_for_everyone()# resume pretrained feature embedding+ dinov3_weights_loaded = Falseif args.feature_embedding_type.startswith('dinov3'):vit_type = args.feature_embedding_type.split('_')[-1]assert vit_type in ['vits16', 'vits16plus', 'vitb16', 'vitl16', 'vith16plus', 'vit7b16'], f'ViT type {vit_type} not supported for DINOv3 feature embedding'@@ -707,12 +708,9 @@ def main(args):if os.path.exists(ckpt_path):ckpts = torch.load(ckpt_path, map_location='cpu')model_without_ddp.net.y_embedder.load_state_dict(ckpts, strict=True)+ dinov3_weights_loaded = Trueprint(f'Loaded pretrained DINOv3 {vit_type} from {ckpt_path}')elif args.pretrained is None:- # With --pretrained the encoder arrives with the checkpoint (net.y_embedder.*),- # loaded further below, so a missing gated file is normal and not worth a line of- # output. Without one there is nothing else to initialise the encoder from, so the- # run really would condition on a random encoder: say so.print(f'[DINOv3] {ckpt_path} not found -> encoder left randomly initialised. 'f'Download the gated LVD-1689M weights to train from scratch.')@@ -773,16 +771,26 @@ def main(args):assert os.path.exists(args.pretrained)checkpoint = torch.load(args.pretrained, map_location='cpu', weights_only=False)- # Slim checkpoints produced by tools/extract_ema.py carry a single weight set under- # 'model' and no EMA copies. Skip all EMA handling for them so only one copy of the- # parameters reaches the GPU (a full PointDiT-H checkpoint otherwise needs ~3x).- has_ema = 'model_ema1' in checkpoint and 'model_ema2' in checkpoint+ # The released checkpoints ship without the frozen DINOv3 encoder: those weights are+ # gated and cannot be redistributed+ dinov3_stripped = checkpoint.get('dinov3_stripped')+ if dinov3_stripped is not None and not dinov3_weights_loaded:+ raise FileNotFoundError(+ f'"{args.pretrained}" was released without the frozen DINOv3 '+ f'{dinov3_stripped.get("variant", vit_type)} encoder, and the encoder weights '+ f'were not found at "{ckpt_path}".\n'+ f'Request access at https://github.com/facebookresearch/dinov3, then place '+ f'{dinov3_stripped.get("upstream_filename", "the weights")} in '+ f'pretrained/dinov3/, or set DINOV3_WEIGHTS_DIR to the directory holding it.')++ # A checkpoint carries up to two EMA copies. The released ones keep only 'model_ema1'+ ema_keys = [k for k in ('model_ema1', 'model_ema2') if k in checkpoint]+ has_ema = 'model_ema1' in checkpointif args.resize_posemb:# Update the checkpoint dict (key matches your error: 'net.pos_embed')patch_size = int(args.model.split('/')[-1])new_num_patches = (args.img_size // patch_size) ** 2- ema_keys = ['model_ema1', 'model_ema2'] if has_ema else []for key in ['model'] + ema_keys:checkpoint[key] = resize_vit_pos_embed(checkpoint[key], new_num_patches=new_num_patches, key='net.pos_embed')@@ -794,12 +802,23 @@ def main(args):if args.resize_patch_embed > 0:new_patch_size = int(args.model.split('/')[-1])- ema_keys = ['model_ema1', 'model_ema2'] if has_ema else []for key in ['model'] + ema_keys:checkpoint[key] = resize_patch_embed_and_final_layer(checkpoint[key], args.resize_patch_embed, new_patch_size, out_channels=3)- model_without_ddp.load_state_dict(checkpoint['model'], strict=not args.no_strict_load)+ if dinov3_stripped is not None and not args.no_strict_load:+ # Tolerate exactly the encoder keys the release removed -- already loaded above --+ # and keep every other mismatch fatal, which a blanket --no_strict_load would not.+ prefix = dinov3_stripped.get('prefix', 'net.y_embedder.')+ incompatible = model_without_ddp.load_state_dict(checkpoint['model'], strict=False)+ missing = [k for k in incompatible.missing_keys if not k.startswith(prefix)]+ if missing or incompatible.unexpected_keys:+ raise RuntimeError(+ 'Error(s) in loading state_dict for {}:\n\tMissing keys: {}\n\t'+ 'Unexpected keys: {}'.format(type(model_without_ddp).__name__,+ missing, incompatible.unexpected_keys))+ else:+ model_without_ddp.load_state_dict(checkpoint['model'], strict=not args.no_strict_load)if args.evaluate_gen and 'epoch' in checkpoint:args.start_epoch = checkpoint['epoch']@@ -817,7 +836,9 @@ def main(args):print('resume pretrained ema')ema_state_dict1 = checkpoint['model_ema1']- ema_state_dict2 = checkpoint['model_ema2']+ # Only ema_params1 is read at evaluation time, so the released checkpoints drop the+ # second copy; the partial resume below then falls back to the loaded weights for it.+ ema_state_dict2 = checkpoint.get('model_ema2', {})# partial resumemodel_without_ddp.ema_params1 = []diff --git a/model.py b/model.pyindex a3bfbe0..148e83c 100644--- a/model.py+++ b/model.py@@ -320,10 +320,6 @@ class PointDiT(nn.Module):self.y_embedder = torch.hub.load(dinov3_repo, f'dinov3_{vit_type}', source='local', weights=local_weights_path)else:- # Every PointDiT checkpoint already stores the DINOv3 encoder weights under- # net.y_embedder.*, so evaluation/inference only needs the architecture here.- # The gated LVD-1689M weights are required only to train from scratch, and- # main.py warns about that case (it can see whether a checkpoint is coming).self.y_embedder = torch.hub.load(dinov3_repo, f'dinov3_{vit_type}', source='local', pretrained=False)# freeze DINOv3 parameters@@ -687,9 +683,3 @@ PointDiT_models = {'PointDiT-H/16': PointDiT_H_16,}-# Legacy aliases. This repository began as a fork of JiT (see THIRD_PARTY_NOTICES),-# whose architecture names it used until the public release. Accepted so older-# --model strings keep working; prefer the PointDiT-* names above.-PointDiT_models['JiT-B/16'] = PointDiT_B_16-PointDiT_models['JiT-L/16'] = PointDiT_L_16-PointDiT_models['JiT-H/16'] = PointDiT_H_16diff --git a/scripts/demo_b_512.sh b/scripts/demo_b_512.shindex 6d6da20..f0c083c 100755--- a/scripts/demo_b_512.sh+++ b/scripts/demo_b_512.sh@@ -16,7 +16,7 @@# PointDiT-B (512x512) on your own images. Set IMAGE_DIR below; .jpg/.png, nested dirs are fine.-# Results go to generation/pretrained-pointditb-512/<IMAGE_DIR folder name>/, so+# Results go to generation/pretrained-pointditb-512-mixdata-nodinov3-1d42aacf/<IMAGE_DIR folder name>/, so# IMAGE_DIR=assets/demo writes to .../demo/. Each output is named after its input:# sample0.png -> sample0_depth.png and sample0_pointcloud.ply.@@ -29,7 +29,10 @@cd "$(dirname "$0")/.."IMAGE_DIR=assets/demo-CHECKPOINT=pretrained/pointditb-512.pth+# The frozen DINOv3 encoder is not part of the checkpoint: its weights are gated, so+# they are downloaded separately into pretrained/dinov3/ (see MODELS.md).+CHECKPOINT=pretrained/pointditb-512-mixdata-nodinov3-1d42aacf.pth+export DINOV3_WEIGHTS_DIR=${DINOV3_WEIGHTS_DIR:-pretrained/dinov3}python main.py \--model PointDiT-B/16 --feature_embedding_type dinov3_vitb16 --proj_dropout 0.0 \diff --git a/scripts/demo_h_512.sh b/scripts/demo_h_512.shindex 72bc78b..35b21d2 100755--- a/scripts/demo_h_512.sh+++ b/scripts/demo_h_512.sh@@ -16,7 +16,7 @@# PointDiT-H (512x512) on your own images. Set IMAGE_DIR below; .jpg/.png, nested dirs are fine.-# Results go to generation/pretrained-pointdith-512/<IMAGE_DIR folder name>/, so+# Results go to generation/pretrained-pointdith-512-mixdata-nodinov3-cb01dd3b/<IMAGE_DIR folder name>/, so# IMAGE_DIR=assets/demo writes to .../demo/. Each output is named after its input:# sample0.png -> sample0_depth.png and sample0_pointcloud.ply.@@ -29,7 +29,10 @@cd "$(dirname "$0")/.."IMAGE_DIR=assets/demo-CHECKPOINT=pretrained/pointdith-512.pth+# The frozen DINOv3 encoder is not part of the checkpoint: its weights are gated, so+# they are downloaded separately into pretrained/dinov3/ (see MODELS.md).+CHECKPOINT=pretrained/pointdith-512-mixdata-nodinov3-cb01dd3b.pth+export DINOV3_WEIGHTS_DIR=${DINOV3_WEIGHTS_DIR:-pretrained/dinov3}python main.py \--model PointDiT-H/16 --feature_embedding_type dinov3_vith16plus --proj_dropout 0.2 \diff --git a/scripts/demo_l_512.sh b/scripts/demo_l_512.shindex e250fb8..c615105 100755--- a/scripts/demo_l_512.sh+++ b/scripts/demo_l_512.sh@@ -16,7 +16,7 @@# PointDiT-L (512x512) on your own images. Set IMAGE_DIR below; .jpg/.png, nested dirs are fine.-# Results go to generation/pretrained-pointditl-512/<IMAGE_DIR folder name>/, so+# Results go to generation/pretrained-pointditl-512-mixdata-nodinov3-240c1a4f/<IMAGE_DIR folder name>/, so# IMAGE_DIR=assets/demo writes to .../demo/. Each output is named after its input:# sample0.png -> sample0_depth.png and sample0_pointcloud.ply.@@ -29,7 +29,10 @@cd "$(dirname "$0")/.."IMAGE_DIR=assets/demo-CHECKPOINT=pretrained/pointditl-512.pth+# The frozen DINOv3 encoder is not part of the checkpoint: its weights are gated, so+# they are downloaded separately into pretrained/dinov3/ (see MODELS.md).+CHECKPOINT=pretrained/pointditl-512-mixdata-nodinov3-240c1a4f.pth+export DINOV3_WEIGHTS_DIR=${DINOV3_WEIGHTS_DIR:-pretrained/dinov3}python main.py \--model PointDiT-L/16 --feature_embedding_type dinov3_vitl16 --proj_dropout 0.0 \diff --git a/scripts/eval_b_256.sh b/scripts/eval_b_256.shindex 5d9ce5d..dfea7ba 100755--- a/scripts/eval_b_256.sh+++ b/scripts/eval_b_256.sh@@ -22,7 +22,10 @@cd "$(dirname "$0")/.."-CHECKPOINT=pretrained/pointditb-256-scenenet.pth+# The frozen DINOv3 encoder is not part of the checkpoint: its weights are gated, so+# they are downloaded separately into pretrained/dinov3/ (see MODELS.md).+CHECKPOINT=pretrained/pointditb-256-scenenet-nodinov3-58f0b231.pth+export DINOV3_WEIGHTS_DIR=${DINOV3_WEIGHTS_DIR:-pretrained/dinov3}EVAL_DATA=datasets/evalpython main.py \diff --git a/scripts/eval_b_512.sh b/scripts/eval_b_512.shindex 86641aa..ef0372e 100755--- a/scripts/eval_b_512.sh+++ b/scripts/eval_b_512.sh@@ -20,7 +20,10 @@cd "$(dirname "$0")/.."-CHECKPOINT=pretrained/pointditb-512.pth+# The frozen DINOv3 encoder is not part of the checkpoint: its weights are gated, so+# they are downloaded separately into pretrained/dinov3/ (see MODELS.md).+CHECKPOINT=pretrained/pointditb-512-mixdata-nodinov3-1d42aacf.pth+export DINOV3_WEIGHTS_DIR=${DINOV3_WEIGHTS_DIR:-pretrained/dinov3}EVAL_DATA=datasets/evalpython main.py \diff --git a/scripts/eval_h_256.sh b/scripts/eval_h_256.shindex 6d0e191..d55ff7a 100755--- a/scripts/eval_h_256.sh+++ b/scripts/eval_h_256.sh@@ -22,7 +22,10 @@cd "$(dirname "$0")/.."-CHECKPOINT=pretrained/pointdith-256-scenenet.pth+# The frozen DINOv3 encoder is not part of the checkpoint: its weights are gated, so+# they are downloaded separately into pretrained/dinov3/ (see MODELS.md).+CHECKPOINT=pretrained/pointdith-256-scenenet-nodinov3-9dddf3fc.pth+export DINOV3_WEIGHTS_DIR=${DINOV3_WEIGHTS_DIR:-pretrained/dinov3}EVAL_DATA=datasets/evalpython main.py \diff --git a/scripts/eval_h_512.sh b/scripts/eval_h_512.shindex ba8a6e2..e24b1c7 100755--- a/scripts/eval_h_512.sh+++ b/scripts/eval_h_512.sh@@ -21,7 +21,10 @@cd "$(dirname "$0")/.."-CHECKPOINT=pretrained/pointdith-512.pth+# The frozen DINOv3 encoder is not part of the checkpoint: its weights are gated, so+# they are downloaded separately into pretrained/dinov3/ (see MODELS.md).+CHECKPOINT=pretrained/pointdith-512-mixdata-nodinov3-cb01dd3b.pth+export DINOV3_WEIGHTS_DIR=${DINOV3_WEIGHTS_DIR:-pretrained/dinov3}EVAL_DATA=datasets/evalpython main.py \diff --git a/scripts/eval_l_256.sh b/scripts/eval_l_256.shindex b4859a7..7a1705f 100755--- a/scripts/eval_l_256.sh+++ b/scripts/eval_l_256.sh@@ -22,7 +22,10 @@cd "$(dirname "$0")/.."-CHECKPOINT=pretrained/pointditl-256-scenenet.pth+# The frozen DINOv3 encoder is not part of the checkpoint: its weights are gated, so+# they are downloaded separately into pretrained/dinov3/ (see MODELS.md).+CHECKPOINT=pretrained/pointditl-256-scenenet-nodinov3-00141e97.pth+export DINOV3_WEIGHTS_DIR=${DINOV3_WEIGHTS_DIR:-pretrained/dinov3}EVAL_DATA=datasets/evalpython main.py \diff --git a/scripts/eval_l_512.sh b/scripts/eval_l_512.shindex 5afeab4..fb905b8 100755--- a/scripts/eval_l_512.sh+++ b/scripts/eval_l_512.sh@@ -21,7 +21,10 @@cd "$(dirname "$0")/.."-CHECKPOINT=pretrained/pointditl-512.pth+# The frozen DINOv3 encoder is not part of the checkpoint: its weights are gated, so+# they are downloaded separately into pretrained/dinov3/ (see MODELS.md).+CHECKPOINT=pretrained/pointditl-512-mixdata-nodinov3-240c1a4f.pth+export DINOV3_WEIGHTS_DIR=${DINOV3_WEIGHTS_DIR:-pretrained/dinov3}EVAL_DATA=datasets/evalpython main.py \