Skip to content

Commit 0cab331

Browse files
committed
Merge branch 'dev_compression_simulation' into main
2 parents 431cfa1 + 356150e commit 0cab331

File tree

25 files changed

+1939
-3827
lines changed

25 files changed

+1939
-3827
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ temp
138138
!examples/benchmarks/compression/results/
139139
.github/
140140

141+
<<<<<<< HEAD
141142
setup_gscodec.py
142143
*.ipynb
143144
Readme_GSCodec.md
@@ -146,6 +147,9 @@ temp
146147
stats
147148
figs
148149

150+
=======
151+
gsc_utils
152+
>>>>>>> dev_compression_simulation
149153
examples/benchmarks/compression/mpeg_exp
150154
examples/benchmarks/compression/rebuttal
151155
examples/benchmarks/viewer

examples/benchmarks/compression/final_exp/mcmc_tt_sim.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ----------------- Training Setting-------------- #
22
SCENE_DIR="data/tandt"
33
# eval all 9 scenes for benchmarking
4-
SCENE_LIST="train truck" # truck
4+
SCENE_LIST="truck" # train truck
55
# SCENE_LIST="garden bicycle stump bonsai counter kitchen room treehill flowers"
66

77
# # 0.36M GSs
@@ -41,14 +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
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 entropy_coding
5253

5354

5455
# eval: use vgg for lpips to align with other benchmarks
@@ -57,8 +58,8 @@ run_single_scene() {
5758
--data_dir $SCENE_DIR/$SCENE/ \
5859
--result_dir $RESULT_DIR/$SCENE/ \
5960
--lpips_net vgg \
60-
--compression png \
61-
--ckpt $RESULT_DIR/$SCENE/ckpts/ckpt_29999_rank0.pt
61+
--ckpt $RESULT_DIR/$SCENE/ckpts/ckpt_29999_rank0.pt \
62+
--compression entropy_coding
6263

6364
}
6465
# ----------------- Main Job --------------------- #
@@ -76,7 +77,7 @@ do
7677
SCENE_IDX=$((SCENE_IDX + 1))
7778
{
7879
run_single_scene ${GPU_LIST[$SCENE_IDX]} $SCENE
79-
} &
80+
} #&
8081

8182
done
8283

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# ----------------- Training Setting-------------- #
2+
SCENE_DIR="data/tandt"
3+
# eval all 9 scenes for benchmarking
4+
SCENE_LIST="truck train" # truck
5+
# SCENE_LIST="garden bicycle stump bonsai counter kitchen room treehill flowers"
6+
7+
# # 0.36M GSs
8+
# RESULT_DIR="results/benchmark_tt_mcmc_0_36M_png_compression"
9+
# CAP_MAX=360000
10+
11+
# # 0.49M GSs
12+
# RESULT_DIR="results/benchmark_tt_mcmc_tt_0_49M_png_compression"
13+
# CAP_MAX=490000
14+
15+
# 1M GSs
16+
RESULT_DIR="results/Ours_TT_grad_thres"
17+
CAP_MAX=1000000
18+
19+
# # 4M GSs
20+
# RESULT_DIR="results/benchmark_tt_mcmc_4M_png_compression"
21+
# CAP_MAX=4000000
22+
23+
RD_LAMBDA=0.01
24+
25+
# ----------------- Training Setting-------------- #
26+
27+
# ----------------- Args ------------------------- #
28+
29+
if [ ! -z "$1" ]; then
30+
RD_LAMBDA="$1"
31+
RESULT_DIR="results/Ours_TT_rd_lambda_${RD_LAMBDA}"
32+
fi
33+
34+
# ----------------- Args ------------------------- #
35+
36+
# ----------------- Main Job --------------------- #
37+
run_single_scene() {
38+
local GPU_ID=$1
39+
local SCENE=$2
40+
41+
echo "Running $SCENE on GPU: $GPU_ID"
42+
43+
# 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 --shN_ada_mask_strategy gradient
52+
53+
54+
# eval: use vgg for lpips to align with other benchmarks
55+
CUDA_VISIBLE_DEVICES=$GPU_ID python simple_trainer.py mcmc --disable_viewer --data_factor 1 \
56+
--strategy.cap-max $CAP_MAX \
57+
--data_dir $SCENE_DIR/$SCENE/ \
58+
--result_dir $RESULT_DIR/$SCENE/ \
59+
--lpips_net vgg \
60+
--compression png \
61+
--ckpt $RESULT_DIR/$SCENE/ckpts/ckpt_29999_rank0.pt
62+
63+
}
64+
# ----------------- Main Job --------------------- #
65+
66+
67+
68+
# ----------------- Experiment Loop -------------- #
69+
GPU_LIST=(5 6)
70+
GPU_COUNT=${#GPU_LIST[@]}
71+
72+
SCENE_IDX=-1
73+
74+
for SCENE in $SCENE_LIST;
75+
do
76+
SCENE_IDX=$((SCENE_IDX + 1))
77+
{
78+
run_single_scene ${GPU_LIST[$SCENE_IDX]} $SCENE
79+
} &
80+
81+
done
82+
83+
# ----------------- Experiment Loop -------------- #
84+
85+
# Wait for finishing the jobs across all scenes
86+
wait
87+
echo "All scenes finished."
88+
89+
# Zip the compressed files and summarize the stats
90+
if command -v zip &> /dev/null
91+
then
92+
echo "Zipping results"
93+
python benchmarks/compression/summarize_stats.py --results_dir $RESULT_DIR --scenes $SCENE_LIST
94+
else
95+
echo "zip command not found, skipping zipping"
96+
fi

0 commit comments

Comments
 (0)