Upload folder using huggingface_hub
Browse files- LICENSE +21 -0
- README.md +262 -0
- codecsplat-base-dl3dv-256x448-view8-075062d0.pth +3 -0
- codecsplat-base-re10k-256x256-view2-e3a545db.pth +3 -0
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2026 Pengpeng Yu
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
README.md
ADDED
|
@@ -0,0 +1,262 @@
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- 3d-gaussian-splatting
|
| 5 |
+
- novel-view-synthesis
|
| 6 |
+
- compression
|
| 7 |
+
- feed-forward
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
<p align="center">
|
| 11 |
+
<h1 align="center">CodecSplat: Ultra-Compact Latent Coding for Feed-Forward 3D Gaussian Splatting</h1>
|
| 12 |
+
<h3 align="center">
|
| 13 |
+
<a href="https://arxiv.org/abs/2605.25563">Paper</a> |
|
| 14 |
+
<a href="https://github.com/pengpeng-yu/CodecSplat">Code</a> |
|
| 15 |
+
<a href="https://huggingface.co/pengpeng-yu/CodecSplat">Models</a>
|
| 16 |
+
</h3>
|
| 17 |
+
</p>
|
| 18 |
+
|
| 19 |
+
CodecSplat is a latent coding framework for feed-forward 3D Gaussian splatting.
|
| 20 |
+
Instead of compressing the final irregular 3D Gaussian primitives, it
|
| 21 |
+
entropy-codes an intermediate 2D feature representation used for depth and
|
| 22 |
+
Gaussian prediction. This keeps the scene representation compact while
|
| 23 |
+
preserving fast feed-forward reconstruction.
|
| 24 |
+
|
| 25 |
+
## Installation
|
| 26 |
+
|
| 27 |
+
The code is developed with Python 3.10 and PyTorch 2.9.1. Please refer to the official
|
| 28 |
+
[PyTorch installation guide](https://pytorch.org/get-started/locally/) if your
|
| 29 |
+
CUDA version or platform differs from the example below.
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
+
conda create -y -n py310torch291 python=3.10
|
| 33 |
+
conda activate py310torch291
|
| 34 |
+
|
| 35 |
+
pip install torch==2.9.1 torchvision==0.24.1 torchaudio==2.9.1 \
|
| 36 |
+
--index-url https://download.pytorch.org/whl/cu130
|
| 37 |
+
pip install -r requirements.txt
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
## Model Zoo
|
| 41 |
+
|
| 42 |
+
Pretrained weights are available on
|
| 43 |
+
[Hugging Face](https://huggingface.co/pengpeng-yu/CodecSplat):
|
| 44 |
+
|
| 45 |
+
| Checkpoint | Dataset | Input views | Resolution | Notes |
|
| 46 |
+
| --- | --- | ---: | --- | --- |
|
| 47 |
+
| [CodecSplat-Re10K-2view](https://huggingface.co/pengpeng-yu/CodecSplat/resolve/main/codecsplat-base-re10k-256x256-view2-e3a545db.pth) | RealEstate10K | 2 | 256x256 | Variable-rate, lmb=16-1024 |
|
| 48 |
+
| [CodecSplat-DL3DV-8view](https://huggingface.co/pengpeng-yu/CodecSplat/resolve/main/codecsplat-base-dl3dv-256x448-view8-075062d0.pth) | DL3DV | 8 | 256x448 | Variable-rate, lmb=16-1024 |
|
| 49 |
+
|
| 50 |
+
After downloading a checkpoint, place it under `pretrained/` or update the
|
| 51 |
+
`checkpointing.pretrained_model=...` entry in the corresponding test script.
|
| 52 |
+
|
| 53 |
+
## Datasets
|
| 54 |
+
|
| 55 |
+
CodecSplat is evaluated on 256x256 RealEstate10K and 256x448 DL3DV. The
|
| 56 |
+
datasets used by the provided scripts are available from:
|
| 57 |
+
|
| 58 |
+
- [RealEstate10K 360p torch format](https://huggingface.co/datasets/lhmd/re10k_torch)
|
| 59 |
+
- [DL3DV-ALL-480P](https://huggingface.co/datasets/DL3DV/DL3DV-ALL-480P)
|
| 60 |
+
- [DL3DV-Benchmark](https://huggingface.co/datasets/DL3DV/DL3DV-Benchmark)
|
| 61 |
+
|
| 62 |
+
The RealEstate10K release above is already in the expected torch-chunk format.
|
| 63 |
+
For DL3DV, convert the downloaded source data with:
|
| 64 |
+
|
| 65 |
+
```bash
|
| 66 |
+
mkdir -p datasets
|
| 67 |
+
|
| 68 |
+
# DL3DV benchmark/test split.
|
| 69 |
+
python src/scripts/convert_dl3dv.py \
|
| 70 |
+
--split test \
|
| 71 |
+
--input_dir /path/to/DL3DV-Benchmark \
|
| 72 |
+
--output_dir datasets/DL3DV-Benchmark-480P-Processed \
|
| 73 |
+
--img_subdir images_8
|
| 74 |
+
|
| 75 |
+
# DL3DV training split. Test scenes are excluded by index.
|
| 76 |
+
python src/scripts/convert_dl3dv.py \
|
| 77 |
+
--split train \
|
| 78 |
+
--input_dir /path/to/DL3DV-ALL-480P \
|
| 79 |
+
--output_dir datasets/DL3DV-ALL-480P-Processed \
|
| 80 |
+
--img_subdir images_8 \
|
| 81 |
+
--test_index_path datasets/DL3DV-Benchmark-480P-Processed/test/index.json
|
| 82 |
+
|
| 83 |
+
# Use the DL3DV benchmark split as the test split for DL3DV evaluation.
|
| 84 |
+
ln -s ../DL3DV-Benchmark-480P-Processed/test datasets/DL3DV-ALL-480P-Processed/test
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
The resulting layout should look like:
|
| 88 |
+
|
| 89 |
+
```text
|
| 90 |
+
datasets
|
| 91 |
+
βββ DL3DV-ALL-480P
|
| 92 |
+
β βββ 1K
|
| 93 |
+
β β βββ 0a1b7c20...
|
| 94 |
+
β β β βββ images_8 # 270x480
|
| 95 |
+
β β β βββ transforms.json
|
| 96 |
+
β β βββ ...
|
| 97 |
+
βββ DL3DV-Benchmark
|
| 98 |
+
β βββ 0a1b7c20...
|
| 99 |
+
β β βββ images_8 # 270x480
|
| 100 |
+
β β βββ transforms.json
|
| 101 |
+
β βββ ...
|
| 102 |
+
βββ RE10K-Torch-360p
|
| 103 |
+
β βββ train
|
| 104 |
+
β β βββ 000000.torch
|
| 105 |
+
β β βββ ...
|
| 106 |
+
β β βββ index.json
|
| 107 |
+
β βββ test
|
| 108 |
+
β βββ 000000.torch
|
| 109 |
+
β βββ ...
|
| 110 |
+
β βββ index.json
|
| 111 |
+
βββ DL3DV-ALL-480P-Processed
|
| 112 |
+
β βββ train
|
| 113 |
+
β β βββ 000000.torch
|
| 114 |
+
β β βββ ...
|
| 115 |
+
β β βββ index.json
|
| 116 |
+
β βββ test -> ../DL3DV-Benchmark-480P-Processed/test
|
| 117 |
+
βββ DL3DV-Benchmark-480P-Processed
|
| 118 |
+
βββ test
|
| 119 |
+
βββ 000000.torch
|
| 120 |
+
βββ ...
|
| 121 |
+
βββ index.json
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
## Evaluation
|
| 125 |
+
|
| 126 |
+
The main codec evaluation entry point is:
|
| 127 |
+
|
| 128 |
+
```bash
|
| 129 |
+
# Run both datasets at the default rate points, lmb=16 and lmb=1024.
|
| 130 |
+
python scripts/test_codec_bitstream_rd.py all
|
| 131 |
+
|
| 132 |
+
# Run one dataset at selected rate points.
|
| 133 |
+
python scripts/test_codec_bitstream_rd.py dl3dv 16 128 1024
|
| 134 |
+
python scripts/test_codec_bitstream_rd.py re10k 16 128 1024
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
Equivalent single-dataset shell scripts are also provided:
|
| 138 |
+
|
| 139 |
+
```bash
|
| 140 |
+
# DL3DV 8-view 256x448 evaluation.
|
| 141 |
+
lmb=1024 bash scripts/test_dl3dv_view8_256x448.sh
|
| 142 |
+
|
| 143 |
+
# RealEstate10K 2-view 256x256 evaluation.
|
| 144 |
+
lmb=1024 bash scripts/test_re10k_view2_256x256.sh
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
Useful test flags:
|
| 148 |
+
|
| 149 |
+
- `test.save_image=true`: save rendered target views.
|
| 150 |
+
- `test.save_gt_image=true`: save ground-truth target views.
|
| 151 |
+
- `test.save_input_images=true`: save context/input views.
|
| 152 |
+
- `test.save_depth=true`: save predicted depths.
|
| 153 |
+
- `test.save_gaussian=true`: save reconstructed Gaussian primitives as PLY.
|
| 154 |
+
- `test.save_video=true`: save rendered target-view sequences as MP4 when the
|
| 155 |
+
evaluation index contains consecutive frames.
|
| 156 |
+
- `model.encoder.codec_lmb_range=[L,L]`: evaluate a fixed rate point L.
|
| 157 |
+
- `model.encoder.codec_eval_use_bitstream=true`: run actual compress/decompress bitstream evaluation.
|
| 158 |
+
|
| 159 |
+
## Video Rendering
|
| 160 |
+
|
| 161 |
+
CodecSplat supports video rendering through `test.save_video=true`.
|
| 162 |
+
|
| 163 |
+
```bash
|
| 164 |
+
CUDA_VISIBLE_DEVICES=0 python -m src.main +experiment=dl3dv \
|
| 165 |
+
mode=test \
|
| 166 |
+
dataset/view_sampler=evaluation \
|
| 167 |
+
dataset.view_sampler.num_context_views=12 \
|
| 168 |
+
dataset.view_sampler.index_path=assets/dl3dv_start_0_distance_100_ctx_12v_video.json \
|
| 169 |
+
dataset.roots=[datasets/DL3DV-Benchmark-480P-Processed] \
|
| 170 |
+
dataset.image_shape=[256,448] \
|
| 171 |
+
dataset.test_len=1 \
|
| 172 |
+
test.save_video=true \
|
| 173 |
+
test.compute_scores=false \
|
| 174 |
+
test.render_chunk_size=10 \
|
| 175 |
+
test.stabilize_camera=true \
|
| 176 |
+
model.encoder.codec_lmb_range=[1024.0,1024.0] \
|
| 177 |
+
model.encoder.codec_eval_use_bitstream=true \
|
| 178 |
+
checkpointing.pretrained_model=/path/to/dl3dv_codec_checkpoint.ckpt \
|
| 179 |
+
checkpointing.no_strict_load=true \
|
| 180 |
+
output_dir=outputs/codecsplat_video_smoke
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
## Training
|
| 184 |
+
|
| 185 |
+
Training is performed in two stages.
|
| 186 |
+
|
| 187 |
+
Stage 1 trains the feed-forward Gaussian reconstruction model without the learned
|
| 188 |
+
feature codec. Stage 2 enables the feature codec and trains the compression path.
|
| 189 |
+
|
| 190 |
+
```bash
|
| 191 |
+
# DL3DV 8-view, 256x448.
|
| 192 |
+
bash scripts/train_dl3dv_view8_256x448_stage1.sh
|
| 193 |
+
bash scripts/train_dl3dv_view8_256x448_stage2.sh
|
| 194 |
+
|
| 195 |
+
# RealEstate10K 2-view, 256x256.
|
| 196 |
+
bash scripts/train_re10k_view2_256x256_stage1.sh
|
| 197 |
+
bash scripts/train_re10k_view2_256x256_stage2.sh
|
| 198 |
+
```
|
| 199 |
+
|
| 200 |
+
The comments in the training scripts use notation such as `1 x 8 GPUs` or
|
| 201 |
+
`4 x 8 GPUs`. This means per-GPU batch size times the number of GPUs. In our
|
| 202 |
+
experiments, the 8-GPU setting refers to 8 NVIDIA RTX 5880 Ada 48GB GPUs. On
|
| 203 |
+
machines with fewer GPUs, gradient accumulation can be used to approximate the
|
| 204 |
+
same effective batch size. For example, replacing 8 GPUs with 4 GPUs can often
|
| 205 |
+
be approximated by doubling `trainer.accumulate_grad_batches`.
|
| 206 |
+
|
| 207 |
+
Most provided training commands use `trainer.precision=bf16-mixed`. Geometry,
|
| 208 |
+
depth probability, entropy-probability, and rasterization-sensitive operations
|
| 209 |
+
are kept in float32 internally where needed.
|
| 210 |
+
|
| 211 |
+
The provided stage-1 training scripts warm-start from DepthSplat Gaussian
|
| 212 |
+
splatting checkpoints. Download the
|
| 213 |
+
corresponding checkpoints before training:
|
| 214 |
+
|
| 215 |
+
```bash
|
| 216 |
+
mkdir -p pretrained
|
| 217 |
+
|
| 218 |
+
# RealEstate10K 2-view 256x256 warm start.
|
| 219 |
+
wget https://huggingface.co/haofeixu/depthsplat/resolve/main/depthsplat-gs-base-re10k-256x256-view2-ca7b6795.pth -P pretrained
|
| 220 |
+
|
| 221 |
+
# DL3DV 2-6 view 256x448 warm start.
|
| 222 |
+
wget https://huggingface.co/haofeixu/depthsplat/resolve/main/depthsplat-gs-base-dl3dv-256x448-randview2-6-02c7b19d.pth -P pretrained
|
| 223 |
+
```
|
| 224 |
+
|
| 225 |
+
Stage-2 training should be initialized from the corresponding stage-1
|
| 226 |
+
checkpoint. Update the `checkpointing.pretrained_model` paths in
|
| 227 |
+
`scripts/train_*_stage2.sh` to your stage-1 output.
|
| 228 |
+
|
| 229 |
+
## Camera Conventions
|
| 230 |
+
|
| 231 |
+
The camera intrinsic matrices are normalized, with the first row divided by the
|
| 232 |
+
image width and the second row divided by the image height.
|
| 233 |
+
|
| 234 |
+
The camera extrinsic matrices follow the OpenCV camera-to-world convention:
|
| 235 |
+
`+X` right, `+Y` down, and `+Z` pointing into the scene.
|
| 236 |
+
|
| 237 |
+
## Citation
|
| 238 |
+
|
| 239 |
+
If you find this project useful, please cite CodecSplat:
|
| 240 |
+
|
| 241 |
+
```bibtex
|
| 242 |
+
@article{yu2026codecsplat,
|
| 243 |
+
title = {CodecSplat: Ultra-Compact Latent Coding for Feed-Forward 3D Gaussian Splatting},
|
| 244 |
+
author = {Yu, Pengpeng and Jiang, Runqing and Zhang, Qi and Li, Dingquan and Wang, Jing and Guo, Yulan},
|
| 245 |
+
journal = {arXiv preprint arXiv:2605.25563},
|
| 246 |
+
year = {2026}
|
| 247 |
+
}
|
| 248 |
+
```
|
| 249 |
+
|
| 250 |
+
## Acknowledgements
|
| 251 |
+
|
| 252 |
+
This project builds on several excellent open-source projects, including
|
| 253 |
+
[DepthSplat](https://github.com/cvg/depthsplat),
|
| 254 |
+
[ReSplat](https://github.com/cvg/resplat),
|
| 255 |
+
[gsplat](https://github.com/nerfstudio-project/gsplat),
|
| 256 |
+
[Depth Anything V2](https://github.com/DepthAnything/Depth-Anything-V2), and
|
| 257 |
+
[lossy-vae](https://github.com/duanzhiihao/lossy-vae).
|
| 258 |
+
|
| 259 |
+
We also thank the dataset authors of
|
| 260 |
+
[RealEstate10K](https://google.github.io/realestate10k/) and
|
| 261 |
+
[DL3DV](https://github.com/DL3DV-10K/Dataset).
|
| 262 |
+
We are grateful to the authors and maintainers for making their work available.
|
codecsplat-base-dl3dv-256x448-view8-075062d0.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:075062d0556a9c1352703d7189e7945e6f6279a091b36f34959336a0eb21768a
|
| 3 |
+
size 744136023
|
codecsplat-base-re10k-256x256-view2-e3a545db.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e3a545db0122693c740451d096a5fa0026e08a9f433d422a9b15066390e7cb48
|
| 3 |
+
size 743619543
|