Skip to content

Commit

Permalink
tt compression script
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruilong Li committed Aug 22, 2024
1 parent 44544f7 commit 265267e
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 12 deletions.
48 changes: 48 additions & 0 deletions examples/benchmarks/compression/mcmc_tt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
SCENE_DIR="data/tandt"
# eval all 9 scenes for benchmarking
SCENE_LIST="train truck"

# # 0.36M GSs
# RESULT_DIR="results/benchmark_tt_mcmc_0_36M_png_compression"
# CAP_MAX=360000

# # 0.49M GSs
# RESULT_DIR="results/benchmark_tt_mcmc_tt_0_49M_png_compression"
# CAP_MAX=490000

# 1M GSs
RESULT_DIR="results/benchmark_tt_mcmc_1M_png_compression"
CAP_MAX=1000000

# # 4M GSs
# RESULT_DIR="results/benchmark_tt_mcmc_4M_png_compression"
# CAP_MAX=4000000

for SCENE in $SCENE_LIST;
do
echo "Running $SCENE"

# train without eval
CUDA_VISIBLE_DEVICES=0 python simple_trainer.py mcmc --eval_steps -1 --disable_viewer --data_factor 1 \
--strategy.cap-max $CAP_MAX \
--data_dir $SCENE_DIR/$SCENE/ \
--result_dir $RESULT_DIR/$SCENE/

# eval: use vgg for lpips to align with other benchmarks
CUDA_VISIBLE_DEVICES=0 python simple_trainer.py mcmc --disable_viewer --data_factor 1 \
--strategy.cap-max $CAP_MAX \
--data_dir $SCENE_DIR/$SCENE/ \
--result_dir $RESULT_DIR/$SCENE/ \
--lpips_net vgg \
--compression png \
--ckpt $RESULT_DIR/$SCENE/ckpts/ckpt_29999_rank0.pt
done

# Zip the compressed files and summarize the stats
if command -v zip &> /dev/null
then
echo "Zipping results"
python benchmarks/compression/summarize_stats.py --results_dir $RESULT_DIR --scenes $SCENE_LIST
else
echo "zip command not found, skipping zipping"
fi
5 changes: 5 additions & 0 deletions examples/benchmarks/compression/results/TanksAndTemples.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Submethod,PSNR,SSIM,LPIPS,Size [Bytes],#Gaussians
,23.54,0.838,0.200,6875669,360000
,23.62,0.845,0.188,8728572,490000
-1.00M,24.03,0.857,0.163,16100628,1000000
,24.47,0.872,0.132,58239022,4000000
15 changes: 3 additions & 12 deletions examples/benchmarks/compression/summarize_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,14 @@
import os
import subprocess
from collections import defaultdict
from typing import List

import numpy as np
import tyro


def main(results_dir: str = "results/benchmark_mcmc_0_36M_png_compression"):
scenes = [
"garden",
"bicycle",
"stump",
"bonsai",
"counter",
"kitchen",
"room",
"treehill",
"flowers",
]
def main(results_dir: str, scenes: List[str]):
print("scenes:", scenes)
stage = "compress"

summary = defaultdict(list)
Expand Down

0 comments on commit 265267e

Please sign in to comment.