Skip to content

Commit 8f8e397

Browse files
liruilong940607Ruilong Li
andauthored
tt compression script (#357)
Co-authored-by: Ruilong Li <397653553@qq.com>
1 parent 44544f7 commit 8f8e397

File tree

3 files changed

+56
-12
lines changed

3 files changed

+56
-12
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
SCENE_DIR="data/tandt"
2+
# eval all 9 scenes for benchmarking
3+
SCENE_LIST="train truck"
4+
5+
# # 0.36M GSs
6+
# RESULT_DIR="results/benchmark_tt_mcmc_0_36M_png_compression"
7+
# CAP_MAX=360000
8+
9+
# # 0.49M GSs
10+
# RESULT_DIR="results/benchmark_tt_mcmc_tt_0_49M_png_compression"
11+
# CAP_MAX=490000
12+
13+
# 1M GSs
14+
RESULT_DIR="results/benchmark_tt_mcmc_1M_png_compression"
15+
CAP_MAX=1000000
16+
17+
# # 4M GSs
18+
# RESULT_DIR="results/benchmark_tt_mcmc_4M_png_compression"
19+
# CAP_MAX=4000000
20+
21+
for SCENE in $SCENE_LIST;
22+
do
23+
echo "Running $SCENE"
24+
25+
# train without eval
26+
CUDA_VISIBLE_DEVICES=0 python simple_trainer.py mcmc --eval_steps -1 --disable_viewer --data_factor 1 \
27+
--strategy.cap-max $CAP_MAX \
28+
--data_dir $SCENE_DIR/$SCENE/ \
29+
--result_dir $RESULT_DIR/$SCENE/
30+
31+
# eval: use vgg for lpips to align with other benchmarks
32+
CUDA_VISIBLE_DEVICES=0 python simple_trainer.py mcmc --disable_viewer --data_factor 1 \
33+
--strategy.cap-max $CAP_MAX \
34+
--data_dir $SCENE_DIR/$SCENE/ \
35+
--result_dir $RESULT_DIR/$SCENE/ \
36+
--lpips_net vgg \
37+
--compression png \
38+
--ckpt $RESULT_DIR/$SCENE/ckpts/ckpt_29999_rank0.pt
39+
done
40+
41+
# Zip the compressed files and summarize the stats
42+
if command -v zip &> /dev/null
43+
then
44+
echo "Zipping results"
45+
python benchmarks/compression/summarize_stats.py --results_dir $RESULT_DIR --scenes $SCENE_LIST
46+
else
47+
echo "zip command not found, skipping zipping"
48+
fi
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Submethod,PSNR,SSIM,LPIPS,Size [Bytes],#Gaussians
2+
,23.54,0.838,0.200,6875669,360000
3+
,23.62,0.845,0.188,8728572,490000
4+
-1.00M,24.03,0.857,0.163,16100628,1000000
5+
,24.47,0.872,0.132,58239022,4000000

examples/benchmarks/compression/summarize_stats.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,14 @@
22
import os
33
import subprocess
44
from collections import defaultdict
5+
from typing import List
56

67
import numpy as np
78
import tyro
89

910

10-
def main(results_dir: str = "results/benchmark_mcmc_0_36M_png_compression"):
11-
scenes = [
12-
"garden",
13-
"bicycle",
14-
"stump",
15-
"bonsai",
16-
"counter",
17-
"kitchen",
18-
"room",
19-
"treehill",
20-
"flowers",
21-
]
11+
def main(results_dir: str, scenes: List[str]):
12+
print("scenes:", scenes)
2213
stage = "compress"
2314

2415
summary = defaultdict(list)

0 commit comments

Comments
 (0)