diff --git a/.gitignore b/.gitignore index 0df0742..3aa1e5a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ diff_rasterization/dist tensorboard_3d screenshots data/ -data \ No newline at end of file +data +argument/ +scripts/ diff --git a/README.md b/README.md index 88b8cec..6e58fbe 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,7 @@ ### [Project Page](https://guanjunwu.github.io/4dgs/index.html)| [Arxiv Paper](https://arxiv.org/abs/2310.08528) - - [Guanjun Wu](https://guanjunwu.github.io/)1*, [Taoran Yi](https://github.com/taoranyi)2*, [Jiemin Fang](https://jaminfong.cn/)3, [Lingxi Xie](http://lingxixie.com/)3,
[Xiaopeng Zhang](https://sites.google.com/site/zxphistory/)3, [Wei Wei](https://www.eric-weiwei.com/)1,[Wenyu Liu](http://eic.hust.edu.cn/professor/liuwenyu/)2, [Qi Tian](https://scholar.google.com/citations?hl=en&user=61b6eYkAAAAJ)3 , [Xinggang Wang](https://xinggangw.info/)2✉ diff --git a/arguments/dnerf_tv/dnerf_default.py b/arguments/dnerf_tv/dnerf_default.py index 1d53e2b..70f183d 100644 --- a/arguments/dnerf_tv/dnerf_default.py +++ b/arguments/dnerf_tv/dnerf_default.py @@ -20,9 +20,9 @@ ModelHiddenParams = dict( multires = [1, 2, 4, 8 ], defor_depth = 0, net_width = 64, - # plane_tv_weight = 0, - # time_smoothness_weight = 0, - # l1_time_planes = 0, + plane_tv_weight = 0.0002, + time_smoothness_weight = 0.001, + l1_time_planes = 0.001, weight_decay_iteration=0, bounds=1.6 ) diff --git a/render.py b/render.py index 8308b66..83e2d99 100644 --- a/render.py +++ b/render.py @@ -40,7 +40,7 @@ def render_set(model_path, name, iteration, views, gaussians, pipeline, backgrou # torchvision.utils.save_image(rendering, os.path.join(render_path, '{0:05d}'.format(idx) + ".png")) render_images.append(to8b(rendering).transpose(1,2,0)) # print(to8b(rendering).shape) - # render_list.append(rendering) + render_list.append(rendering) if name in ["train", "test"]: gt = view.original_image[0:3, :, :] # torchvision.utils.save_image(gt, os.path.join(gts_path, '{0:05d}'.format(idx) + ".png")) diff --git a/scene/gaussian_model.py b/scene/gaussian_model.py index f789ce5..46acb4f 100644 --- a/scene/gaussian_model.py +++ b/scene/gaussian_model.py @@ -18,7 +18,7 @@ from utils.system_utils import mkdir_p from plyfile import PlyData, PlyElement from random import randint from utils.sh_utils import RGB2SH -# from simple_knn._C import distCUDA2 +from simple_knn._C import distCUDA2 from utils.graphics_utils import BasicPointCloud from utils.general_utils import strip_symmetric, build_scaling_rotation from scene.deformation import deform_network @@ -143,7 +143,7 @@ class GaussianModel: print("Number of points at initialisation : ", fused_point_cloud.shape[0]) - dist2 = torch.clamp_min(torch.from_numpy(np.asarray(pcd.points)).float().cuda()) + dist2 = torch.clamp_min(distCUDA2(torch.from_numpy(np.asarray(pcd.points)).float().cuda()), 0.0000001) scales = torch.log(torch.sqrt(dist2))[...,None].repeat(1, 3) rots = torch.zeros((fused_point_cloud.shape[0], 4), device="cuda") rots[:, 0] = 1 @@ -188,6 +188,10 @@ class GaussianModel: lr_final=training_args.deformation_lr_final*self.spatial_lr_scale, lr_delay_mult=training_args.deformation_lr_delay_mult, max_steps=training_args.position_lr_max_steps) + self.grid_scheduler_args = get_expon_lr_func(lr_init=training_args.grid_lr_init*self.spatial_lr_scale, + lr_final=training_args.grid_lr_final*self.spatial_lr_scale, + lr_delay_mult=training_args.deformation_lr_delay_mult, + max_steps=training_args.position_lr_max_steps) def update_learning_rate(self, iteration): ''' Learning rate scheduling per step ''' @@ -196,7 +200,10 @@ class GaussianModel: lr = self.xyz_scheduler_args(iteration) param_group['lr'] = lr # return lr - + if "grid" in param_group["name"]: + lr = self.grid_scheduler_args(iteration) + param_group['lr'] = lr + # return lr elif param_group["name"] == "deformation": lr = self.deformation_scheduler_args(iteration) param_group['lr'] = lr diff --git a/scripts/process_dnerf.sh b/scripts/process_dnerf.sh index a15388c..1ec9b1d 100644 --- a/scripts/process_dnerf.sh +++ b/scripts/process_dnerf.sh @@ -17,26 +17,26 @@ echo "Done" exp_name1=$1 -export CUDA_VISIBLE_DEVICES=2&&python render.py --model_path "output/$exp_name1/standup/" --skip_train --configs arguments/$exp_name1/standup.py & -export CUDA_VISIBLE_DEVICES=3&&python render.py --model_path "output/$exp_name1/jumpingjacks/" --skip_train --configs arguments/$exp_name1/jumpingjacks.py & +export CUDA_VISIBLE_DEVICES=0&&python render.py --model_path "output/$exp_name1/standup/" --skip_train --configs arguments/$exp_name1/standup.py & +export CUDA_VISIBLE_DEVICES=1&&python render.py --model_path "output/$exp_name1/jumpingjacks/" --skip_train --configs arguments/$exp_name1/jumpingjacks.py & export CUDA_VISIBLE_DEVICES=2&&python render.py --model_path "output/$exp_name1/bouncingballs/" --skip_train --configs arguments/$exp_name1/bouncingballs.py & export CUDA_VISIBLE_DEVICES=3&&python render.py --model_path "output/$exp_name1/lego/" --skip_train --configs arguments/$exp_name1/lego.py & wait -export CUDA_VISIBLE_DEVICES=2&&python render.py --model_path "output/$exp_name1/hellwarrior/" --skip_train --configs arguments/$exp_name1/hellwarrior.py & -export CUDA_VISIBLE_DEVICES=3&&python render.py --model_path "output/$exp_name1/hook/" --skip_train --configs arguments/$exp_name1/hook.py & +export CUDA_VISIBLE_DEVICES=0&&python render.py --model_path "output/$exp_name1/hellwarrior/" --skip_train --configs arguments/$exp_name1/hellwarrior.py & +export CUDA_VISIBLE_DEVICES=1&&python render.py --model_path "output/$exp_name1/hook/" --skip_train --configs arguments/$exp_name1/hook.py & export CUDA_VISIBLE_DEVICES=2&&python render.py --model_path "output/$exp_name1/trex/" --skip_train --configs arguments/$exp_name1/trex.py & export CUDA_VISIBLE_DEVICES=3&&python render.py --model_path "output/$exp_name1/mutant/" --skip_train --configs arguments/$exp_name1/mutant.py & # wait echo "Done" exp_name1=$1 -export CUDA_VISIBLE_DEVICES=2&&python metrics.py --model_path "output/$exp_name1/standup/" & -export CUDA_VISIBLE_DEVICES=3&&python metrics.py --model_path "output/$exp_name1/jumpingjacks/" & +export CUDA_VISIBLE_DEVICES=0&&python metrics.py --model_path "output/$exp_name1/standup/" & +export CUDA_VISIBLE_DEVICES=1&&python metrics.py --model_path "output/$exp_name1/jumpingjacks/" & export CUDA_VISIBLE_DEVICES=2&&python metrics.py --model_path "output/$exp_name1/bouncingballs/" & export CUDA_VISIBLE_DEVICES=3&&python metrics.py --model_path "output/$exp_name1/lego/" -export CUDA_VISIBLE_DEVICES=2&&python metrics.py --model_path "output/$exp_name1/hellwarrior/" & -export CUDA_VISIBLE_DEVICES=3&&python metrics.py --model_path "output/$exp_name1/hook/" & +export CUDA_VISIBLE_DEVICES=0&&python metrics.py --model_path "output/$exp_name1/hellwarrior/" & +export CUDA_VISIBLE_DEVICES=1&&python metrics.py --model_path "output/$exp_name1/hook/" & export CUDA_VISIBLE_DEVICES=2&&python metrics.py --model_path "output/$exp_name1/trex/" & export CUDA_VISIBLE_DEVICES=3&&python metrics.py --model_path "output/$exp_name1/mutant/" & wait diff --git a/scripts/read_all_metrics.py b/scripts/read_all_metrics.py index 9894deb..400b657 100644 --- a/scripts/read_all_metrics.py +++ b/scripts/read_all_metrics.py @@ -1,8 +1,7 @@ import json import os -exp_name = ["dnerf_gridlarge","dnerf_gridsmall","dnerf_gridsmaller","dnerf_mlplarge","dnerf_mlplarger","dnerf_nocoarse","dnerf_silm","dnerf_imageloss", - "dnerf_3dgs","dnerf_tv","dnerf_noboth","dnerf_nogrid"] -scene_name = ["bouncingball","jumpingjack","lego","standup","hook","mutant","hellwarrior","trex"] +exp_name = ["dnerf_tv_test"] +scene_name = ["bouncingballs","jumpingjacks","lego","standup","hook","mutant","hellwarrior","trex"] json_name = "results.json" result_json = {"SSIM":0,"PSNR":0,"LPIPS":0} exp_json = {}