forked from fudan-zvg/4d-gaussian-splatting
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5113c7
commit 6e16f65
Showing
764 changed files
with
114,156 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
*.pyc | ||
data | ||
output | ||
build | ||
diff_rasterization/diff_rast.egg-info | ||
diff_rasterization/dist | ||
submodules/ | ||
SIBR_viewers/ | ||
submodules/* | ||
*.dump | ||
pointops2/pointops2.egg-info | ||
simple-knn/simple_knn.egg-info | ||
__pycache__/ | ||
*.so | ||
.Python | ||
.vscode/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
eggs/ | ||
.eggs/ | ||
*.egg | ||
*.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# | ||
# Copyright (C) 2023, Inria | ||
# GRAPHDECO research group, https://team.inria.fr/graphdeco | ||
# All rights reserved. | ||
# | ||
# This software is free for non-commercial, research and evaluation use | ||
# under the terms of the LICENSE.md file. | ||
# | ||
# For inquiries contact [email protected] | ||
# | ||
|
||
from argparse import ArgumentParser, Namespace | ||
import sys | ||
import os | ||
|
||
class GroupParams: | ||
pass | ||
|
||
class ParamGroup: | ||
def __init__(self, parser: ArgumentParser, name : str, fill_none = False): | ||
group = parser.add_argument_group(name) | ||
for key, value in vars(self).items(): | ||
shorthand = False | ||
if key.startswith("_"): | ||
shorthand = True | ||
key = key[1:] | ||
t = type(value) | ||
value = value if not fill_none else None | ||
if shorthand: | ||
if t == bool: | ||
group.add_argument("--" + key, ("-" + key[0:1]), default=value, action="store_true") | ||
else: | ||
group.add_argument("--" + key, ("-" + key[0:1]), default=value, type=t) | ||
else: | ||
if t == bool: | ||
group.add_argument("--" + key, default=value, action="store_true") | ||
else: | ||
group.add_argument("--" + key, default=value, type=t) | ||
|
||
def extract(self, args): | ||
group = GroupParams() | ||
for arg in vars(args).items(): | ||
if arg[0] in vars(self) or ("_" + arg[0]) in vars(self): | ||
setattr(group, arg[0], arg[1]) | ||
return group | ||
|
||
class ModelParams(ParamGroup): | ||
def __init__(self, parser, sentinel=False): | ||
self.sh_degree = 3 | ||
self._source_path = "" | ||
self._model_path = "" | ||
self._images = "images" | ||
self._resolution = -1 | ||
self._white_background = False | ||
self.data_device = "cuda" | ||
self.eval = False | ||
self.extension = ".png" | ||
self.num_extra_pts = 0 | ||
self.loaded_pth = "" | ||
self.frame_ratio = 1 | ||
self.dataloader = False | ||
super().__init__(parser, "Loading Parameters", sentinel) | ||
|
||
def extract(self, args): | ||
g = super().extract(args) | ||
g.source_path = os.path.abspath(g.source_path) | ||
return g | ||
|
||
class PipelineParams(ParamGroup): | ||
def __init__(self, parser): | ||
self.convert_SHs_python = False | ||
self.compute_cov3D_python = False | ||
self.debug = False | ||
self.env_map_res = 0 | ||
self.env_optimize_until = 1000000000 | ||
self.env_optimize_from = 0 | ||
self.eval_shfs_4d = False | ||
super().__init__(parser, "Pipeline Parameters") | ||
|
||
class OptimizationParams(ParamGroup): | ||
def __init__(self, parser): | ||
self.iterations = 30_000 | ||
self.position_lr_init = 0.00016 | ||
self.position_t_lr_init = -1.0 | ||
self.position_lr_final = 0.0000016 | ||
self.position_lr_delay_mult = 0.01 | ||
self.position_lr_max_steps = 30_000 | ||
self.feature_lr = 0.0025 | ||
self.opacity_lr = 0.05 | ||
self.scaling_lr = 0.005 | ||
self.rotation_lr = 0.001 | ||
self.percent_dense = 0.01 | ||
self.lambda_dssim = 0.2 | ||
self.thresh_opa_prune = 0.005 | ||
self.densification_interval = 100 | ||
self.opacity_reset_interval = 3000 | ||
self.densify_from_iter = 500 | ||
self.densify_until_iter = 15_000 | ||
self.densify_grad_threshold = 0.0002 | ||
self.densify_grad_t_threshold = 0.0002 / 40 | ||
self.densify_until_num_points = -1 | ||
self.final_prune_from_iter = -1 | ||
self.sh_increase_interval = 1000 | ||
self.lambda_opa_mask = 0.0 | ||
self.lambda_rigid = 0.0 | ||
self.lambda_motion = 0.0 | ||
super().__init__(parser, "Optimization Parameters") | ||
|
||
def get_combined_args(parser : ArgumentParser): | ||
cmdlne_string = sys.argv[1:] | ||
cfgfile_string = "Namespace()" | ||
args_cmdline = parser.parse_args(cmdlne_string) | ||
|
||
try: | ||
cfgfilepath = os.path.join(args_cmdline.model_path, "cfg_args") | ||
print("Looking for config file in", cfgfilepath) | ||
with open(cfgfilepath) as cfg_file: | ||
print("Config file found: {}".format(cfgfilepath)) | ||
cfgfile_string = cfg_file.read() | ||
except TypeError: | ||
print("Config file not found at") | ||
pass | ||
args_cfgfile = eval(cfgfile_string) | ||
|
||
merged_dict = vars(args_cfgfile).copy() | ||
for k,v in vars(args_cmdline).items(): | ||
if v != None: | ||
merged_dict[k] = v | ||
return Namespace(**merged_dict) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
gaussian_dim: 4 | ||
time_duration: [0.0, 1.0] | ||
num_pts: 100_000 | ||
num_pts_ratio: 1.0 | ||
rot_4d: True | ||
force_sh_3d: False | ||
batch_size: 2 | ||
exhaust_test: True | ||
|
||
ModelParams: | ||
sh_degree: 3 | ||
source_path: "data/dnerf/bouncingballs" | ||
model_path: "output/dnerf/bouncingballs/" | ||
images: "images" | ||
resolution: 2 | ||
white_background: False | ||
data_device: "cuda" | ||
eval: True | ||
extension: ".png" | ||
num_extra_pts: 0 | ||
loaded_pth: "" | ||
frame_ratio: 1 | ||
dataloader: False | ||
|
||
PipelineParams: | ||
convert_SHs_python: False | ||
compute_cov3D_python: False | ||
debug: False | ||
env_map_res: 0 | ||
env_optimize_until: 1000000000 | ||
env_optimize_from: 0 | ||
eval_shfs_4d: True | ||
|
||
OptimizationParams: | ||
iterations: 20_000 | ||
position_lr_init: 0.00016 | ||
position_t_lr_init: -1.0 | ||
position_lr_final: 0.0000016 | ||
position_lr_delay_mult: 0.01 | ||
position_lr_max_steps: 15_000 | ||
feature_lr: 0.0025 | ||
opacity_lr: 0.05 | ||
scaling_lr: 0.005 | ||
rotation_lr: 0.001 | ||
percent_dense: 0.01 | ||
lambda_dssim: 0.2 | ||
thresh_opa_prune: 0.005 | ||
densification_interval: 200 | ||
opacity_reset_interval: 3000 | ||
densify_from_iter: 500 | ||
densify_until_iter: 10_000 | ||
densify_grad_threshold: 0.0002 | ||
densify_grad_t_threshold: 0.0002 / 40 # 想办法用上 | ||
densify_until_num_points: -1 | ||
final_prune_from_iter: -1 | ||
sh_increase_interval: 1000 | ||
lambda_opa_mask: 0.0 | ||
lambda_rigid: 0.0 | ||
lambda_motion: 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
gaussian_dim: 4 | ||
time_duration: [0.0, 1.0] | ||
num_pts: 100_000 | ||
num_pts_ratio: 1.0 | ||
rot_4d: True | ||
force_sh_3d: False | ||
batch_size: 1 | ||
exhaust_test: True | ||
|
||
ModelParams: | ||
sh_degree: 3 | ||
source_path: "data/dnerf/hellwarrior" | ||
model_path: "output/dnerf/hellwarrior" | ||
images: "images" | ||
resolution: 2 | ||
white_background: False | ||
data_device: "cuda" | ||
eval: True | ||
extension: ".png" | ||
num_extra_pts: 0 | ||
loaded_pth: "" | ||
frame_ratio: 1 | ||
dataloader: False | ||
|
||
PipelineParams: | ||
convert_SHs_python: False | ||
compute_cov3D_python: False | ||
debug: False | ||
env_map_res: 0 | ||
env_optimize_until: 1000000000 | ||
env_optimize_from: 0 | ||
eval_shfs_4d: True | ||
|
||
OptimizationParams: | ||
iterations: 30_000 | ||
position_lr_init: 0.00016 | ||
position_t_lr_init: -1.0 | ||
position_lr_final: 0.0000016 | ||
position_lr_delay_mult: 0.01 | ||
position_lr_max_steps: 30_000 | ||
feature_lr: 0.0025 | ||
opacity_lr: 0.05 | ||
scaling_lr: 0.005 | ||
rotation_lr: 0.001 | ||
percent_dense: 0.01 | ||
lambda_dssim: 0.2 | ||
thresh_opa_prune: 0.005 | ||
densification_interval: 100 | ||
opacity_reset_interval: 3000 | ||
densify_from_iter: 500 | ||
densify_until_iter: 15_000 | ||
densify_grad_threshold: 0.0002 | ||
densify_grad_t_threshold: 0.0002 / 40 # 想办法用上 | ||
densify_until_num_points: -1 | ||
final_prune_from_iter: -1 | ||
sh_increase_interval: 1000 | ||
lambda_opa_mask: 0.0 | ||
lambda_rigid: 0.0 | ||
lambda_motion: 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
gaussian_dim: 4 | ||
time_duration: [0.0, 1.0] | ||
num_pts: 300_000 | ||
num_pts_ratio: 1.0 | ||
rot_4d: True | ||
force_sh_3d: False | ||
batch_size: 8 | ||
exhaust_test: True | ||
|
||
ModelParams: | ||
sh_degree: 3 | ||
source_path: "data/dnerf/hook" | ||
model_path: "output/dnerf/hook" | ||
images: "images" | ||
resolution: 2 | ||
white_background: False | ||
data_device: "cuda" | ||
eval: True | ||
extension: ".png" | ||
num_extra_pts: 0 | ||
loaded_pth: "" | ||
frame_ratio: 1 | ||
dataloader: False | ||
|
||
PipelineParams: | ||
convert_SHs_python: False | ||
compute_cov3D_python: False | ||
debug: False | ||
env_map_res: 0 | ||
env_optimize_until: 1000000000 | ||
env_optimize_from: 0 | ||
eval_shfs_4d: True | ||
|
||
OptimizationParams: | ||
iterations: 30_000 | ||
position_lr_init: 0.00016 | ||
position_t_lr_init: -1.0 | ||
position_lr_final: 0.0000016 | ||
position_lr_delay_mult: 0.01 | ||
position_lr_max_steps: 30_000 | ||
feature_lr: 0.0025 | ||
opacity_lr: 0.05 | ||
scaling_lr: 0.005 | ||
rotation_lr: 0.001 | ||
percent_dense: 0.01 | ||
lambda_dssim: 0.2 | ||
thresh_opa_prune: 0.005 | ||
densification_interval: 100 | ||
opacity_reset_interval: 3000 | ||
densify_from_iter: 500 | ||
densify_until_iter: 15_000 | ||
densify_grad_threshold: 0.0002 | ||
densify_grad_t_threshold: 0.0002 / 40 # 想办法用上 | ||
densify_until_num_points: -1 | ||
final_prune_from_iter: -1 | ||
sh_increase_interval: 1000 | ||
lambda_opa_mask: 0.0 | ||
lambda_rigid: 0.0 | ||
lambda_motion: 0.0 |
Oops, something went wrong.