Skip to content

Commit d052650

Browse files
committed
misc: update README.md for dynamic splats-related scripts
1 parent 3f0852b commit d052650

File tree

15 files changed

+748
-15
lines changed

15 files changed

+748
-15
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,25 @@ pip install git+https://github.com/fraunhoferhhi/PLAS.git
6060
We provide a script that enables more memory-efficient Gaussian splats while maintaining high visual quality, such as representing the Truck scene with only about 8MB of storage. The script includes 1) the static splats training with compression simulation, 2) the compression of trained static splats, and 3) the metric evaluation of uncompressed and compressed static splats.
6161

6262
```bash
63+
# Tanks and Temples dataset
6364
bash benchmarks/compression/final_exp/mcmc_tt_sim.sh
6465
```
6566

6667
**Dynamic Gaussian Splats Training and Compression**
67-
(Will be provided on 2/15/2025)
68+
First, please follow the dataset preprocessing instruction described in the [file]((mpeg_gsc_utils/multiview_video_preprocess/README.md)) for training data prepration.
69+
70+
Next, run the script for dynamic gaussian splats training and compression.
71+
```bash
72+
cd examples
73+
bash benchmarks/dyngs/dyngs.sh
74+
```
6875

6976
**Extract Per-Frame Static Gaussian from Dynamic Splats**
70-
(Will be provided on 2/15/2025)
77+
If you finsh the training of dynamic splats, then you can use the script to extract static gaussian splats stored at discrte timesteps in ".ply" file
78+
```bash
79+
cd examples
80+
bash benchmarks/dyngs/export_plys.sh
81+
```
7182

7283
## Contributors
7384

examples/benchmarks/compression/final_exp/mcmc_tt_sim.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ run_single_scene() {
4141
echo "Running $SCENE on GPU: $GPU_ID"
4242

4343
# train without eval
44-
CUDA_VISIBLE_DEVICES=$GPU_ID python simple_trainer.py mcmc --eval_steps -1 --disable_viewer --data_factor 1 \
45-
--strategy.cap-max $CAP_MAX \
46-
--data_dir $SCENE_DIR/$SCENE/ \
47-
--result_dir $RESULT_DIR/$SCENE/ \
48-
--compression_sim \
49-
--entropy_model_opt \
50-
--rd_lambda $RD_LAMBDA \
51-
--shN_ada_mask_opt \
52-
--compression png
44+
# CUDA_VISIBLE_DEVICES=$GPU_ID python simple_trainer.py mcmc --eval_steps -1 --disable_viewer --data_factor 1 \
45+
# --strategy.cap-max $CAP_MAX \
46+
# --data_dir $SCENE_DIR/$SCENE/ \
47+
# --result_dir $RESULT_DIR/$SCENE/ \
48+
# --compression_sim \
49+
# --entropy_model_opt \
50+
# --rd_lambda $RD_LAMBDA \
51+
# --shN_ada_mask_opt \
52+
# --compression png
5353

5454

5555
# eval: use vgg for lpips to align with other benchmarks

examples/benchmarks/dyngs/dyngs.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
SCENE_DIR="data/GSC"
2+
SCENE_LIST="Bartender" # CBA Bartender
3+
4+
declare -A TEST_VIEWS
5+
TEST_VIEWS=(
6+
["CBA"]="7 22"
7+
["Bartender"]="8 10 12"
8+
)
9+
10+
RESULT_DIR="results/dyngs"
11+
12+
NUM_FRAME=65
13+
14+
run_single_scene() {
15+
local GPU_ID=$1
16+
local SCENE=$2
17+
local TEST_VIEW_IDS=${TEST_VIEWS[$SCENE]}
18+
19+
echo "Running $SCENE"
20+
21+
CUDA_VISIBLE_DEVICES=$GPU_ID python simple_trainer_dyngs.py compression_sim \
22+
--model_path $RESULT_DIR/$SCENE/ \
23+
--data_dir $SCENE_DIR/$SCENE/colmap/colmap_50 \
24+
--result_dir $RESULT_DIR/$SCENE/ \
25+
--downscale_factor 1 \
26+
--duration $NUM_FRAME \
27+
--batch_size 2 \
28+
--max_steps 60_000 \
29+
--refine_start_iter 3_000 \
30+
--refine_stop_iter 30_000 \
31+
--refine_every 100 \
32+
--reset_every 6_000 \
33+
--pause_refine_after_reset 500 \
34+
--strategy Modified_STG_Strategy \
35+
--test_view_id $TEST_VIEW_IDS
36+
37+
CUDA_VISIBLE_DEVICES=$GPU_ID python simple_trainer_dyngs.py default \
38+
--model_path $RESULT_DIR/$SCENE/ \
39+
--data_dir $SCENE_DIR/$SCENE/colmap/colmap_50 \
40+
--result_dir $RESULT_DIR/$SCENE/ \
41+
--downscale_factor 1 \
42+
--duration $NUM_FRAME \
43+
--lpips_net vgg \
44+
--compression stg \
45+
--ckpt $RESULT_DIR/$SCENE/ckpts/ckpt_best_rank0.pt \
46+
--test_view_id $TEST_VIEW_IDS
47+
}
48+
49+
GPU_LIST=(7)
50+
GPU_COUNT=${#GPU_LIST[@]}
51+
52+
SCENE_IDX=-1
53+
54+
for SCENE in $SCENE_LIST;
55+
do
56+
SCENE_IDX=$((SCENE_IDX + 1))
57+
{
58+
run_single_scene ${GPU_LIST[$SCENE_IDX]} $SCENE
59+
} #&
60+
61+
done
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
SCENE_DIR="data/GSC"
2+
SCENE_LIST="Bartender" # CBA Bartender
3+
4+
declare -A TEST_VIEWS
5+
TEST_VIEWS=(
6+
["CBA"]="7 22"
7+
["Bartender"]="8 10 12"
8+
)
9+
10+
RESULT_DIR="results/dyngs"
11+
12+
NUM_FRAME=65
13+
14+
run_single_scene() {
15+
local GPU_ID=$1
16+
local SCENE=$2
17+
local TEST_VIEW_IDS=${TEST_VIEWS[$SCENE]}
18+
19+
echo "Running $SCENE"
20+
21+
CUDA_VISIBLE_DEVICES=$GPU_ID python simple_trainer_dyngs.py default \
22+
--model_path $RESULT_DIR/$SCENE/ \
23+
--data_dir $SCENE_DIR/$SCENE/colmap/colmap_50 \
24+
--result_dir $RESULT_DIR/$SCENE/ \
25+
--downscale_factor 1 \
26+
--duration $NUM_FRAME \
27+
--lpips_net vgg \
28+
--compression stg \
29+
--ckpt $RESULT_DIR/$SCENE/ckpts/ckpt_best_rank0.pt \
30+
--test_view_id $TEST_VIEW_IDS \
31+
--enable_dyn_splats_export
32+
}
33+
34+
GPU_LIST=(7)
35+
GPU_COUNT=${#GPU_LIST[@]}
36+
37+
SCENE_IDX=-1
38+
39+
for SCENE in $SCENE_LIST;
40+
do
41+
SCENE_IDX=$((SCENE_IDX + 1))
42+
{
43+
run_single_scene ${GPU_LIST[$SCENE_IDX]} $SCENE
44+
} #&
45+
46+
done

examples/helper/STG/dataset_readers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ def readColmapCameras(cam_extrinsics, cam_intrinsics, images_folder, near, far,
135135
uid = intr.id
136136
R = np.transpose(qvec2rotmat(extr.qvec))
137137
T = np.array(extr.tvec)
138-
139138
if intr.model=="SIMPLE_PINHOLE":
140139
focal_length_x = intr.params[0]
141140
FovY = focal2fov(focal_length_x, height)

examples/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ tensorly
2020
pyyaml
2121
matplotlib
2222
git+https://github.com/rahul-goel/fused-ssim@1272e21a282342e89537159e4bad508b19b34157
23+
24+
natsort

examples/simple_trainer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,9 +1356,9 @@ def main(local_rank: int, world_rank, world_size: int, cfg: Config):
13561356
for k in runner.splats.keys():
13571357
runner.splats[k].data = torch.cat([ckpt["splats"][k] for ckpt in ckpts])
13581358
step = ckpts[0]["step"]
1359-
# runner.save_params_into_ply_file()
1360-
# runner.eval(step=step)
1361-
# runner.render_traj(step=step)
1359+
runner.save_params_into_ply_file()
1360+
runner.eval(step=step)
1361+
runner.render_traj(step=step)
13621362
if cfg.compression is not None:
13631363
if cfg.compression == "entropy_coding":
13641364
runner.load_entropy_model_from_ckpt(ckpts[0], cfg.entropy_model_type)

gsplat/compression/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
from .png_compression import PngCompression
22
from .entropy_coding_compression import EntropyCodingCompression
33
from .hevc_compression import HevcCompression
4+
from .stg_compression import STGPngCompression

mpeg_gsc_utils/__init__.py

Whitespace-only changes.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Preparation for dynamic splats
2+
3+
## Dataset file structure
4+
**MPEG Multiview Video Dataset**
5+
Please organize the data structure as follows:
6+
7+
data/
8+
├── GSC
9+
│ ├── scene1/
10+
│ │ ├── colmap
11+
│ │ ├── mp4
12+
│ │ ├── png
13+
│ │ ├── yuv
14+
│ │ │ ├── v00_texture_1920x1080_yuv420p10le.yuv
15+
│ │ │ ├── v01_texture_1920x1080_yuv420p10le.yuv
16+
│ │ │ ├── ...
17+
│ ├── scene1/
18+
│ │ ├── colmap
19+
│ │ ├── mp4
20+
│ │ ├── png
21+
│ │ ├── yuv
22+
│ │ │ ├── v00_texture_1920x1080_yuv420p10le.yuv
23+
│ │ │ ├── v01_texture_1920x1080_yuv420p10le.yuv
24+
│ │ │ ├── ...
25+
26+
## Operations
27+
1. Convert multiview videos in "yuv" format to "mp4" format and "png" format
28+
```bash
29+
python mpeg_gsc_utils/multiview_video_preprocess/video_preprocess.py
30+
```
31+
2. Obtain the camera intrinsic and extrinsic parameters and save as "poses_bds.npy" file
32+
```bash
33+
python mpeg_gsc_utils/multiview_video_preprocess/gen_poses_bds.py
34+
```
35+
3. Run colmap frame by frame to get per-frame SfM point clouds
36+
```bash
37+
python mpeg_gsc_utils/multiview_video_preprocess/run_per_frame_colmap.py
38+
```

0 commit comments

Comments
 (0)