diff --git a/arguments/dycheck/default.py b/arguments/dycheck/default.py new file mode 100644 index 0000000..188bac4 --- /dev/null +++ b/arguments/dycheck/default.py @@ -0,0 +1,29 @@ +ModelHiddenParams = dict( + kplanes_config = { + 'grid_dimensions': 2, + 'input_coordinate_dim': 4, + 'output_coordinate_dim': 16, + 'resolution': [64, 64, 64, 150] + }, + multires = [1,2,4], + defor_depth = 1, + net_width = 128, + plane_tv_weight = 0.0002, + time_smoothness_weight = 0.001, + l1_time_planes = 0.0001, + render_process=True +) +OptimizationParams = dict( + # dataloader=True, + iterations = 60_000, + batch_size=2, + coarse_iterations = 3000, + densify_until_iter = 10_000, + opacity_reset_interval = 300000, + # grid_lr_init = 0.0016, + # grid_lr_final = 16, + # opacity_threshold_coarse = 0.005, + # opacity_threshold_fine_init = 0.005, + # opacity_threshold_fine_after = 0.005, + # pruning_interval = 2000 +) \ No newline at end of file diff --git a/arguments/dynerf/cook_spinach.py b/arguments/dynerf/cook_spinach.py index 675e985..cec1f7f 100644 --- a/arguments/dynerf/cook_spinach.py +++ b/arguments/dynerf/cook_spinach.py @@ -1,4 +1,5 @@ _base_ = './default.py' OptimizationParams = dict( + batch_size=2, ) \ No newline at end of file diff --git a/arguments/dynerf/cut_roasted_beef.py b/arguments/dynerf/cut_roasted_beef.py index 675e985..b1c5962 100644 --- a/arguments/dynerf/cut_roasted_beef.py +++ b/arguments/dynerf/cut_roasted_beef.py @@ -1,4 +1,4 @@ _base_ = './default.py' OptimizationParams = dict( - + batch_size=2, ) \ No newline at end of file diff --git a/arguments/dynerf/default.py b/arguments/dynerf/default.py index 80851e0..0d4daac 100644 --- a/arguments/dynerf/default.py +++ b/arguments/dynerf/default.py @@ -21,11 +21,11 @@ ModelHiddenParams = dict( ) OptimizationParams = dict( dataloader=True, - iterations = 15000, - batch_size=1, + iterations = 14000, + batch_size=4, coarse_iterations = 3000, densify_until_iter = 10_000, - # opacity_reset_interval = 60000, + opacity_reset_interval = 60000, opacity_threshold_coarse = 0.005, opacity_threshold_fine_init = 0.005, opacity_threshold_fine_after = 0.005, diff --git a/arguments/dynerf/flame_steak.py b/arguments/dynerf/flame_steak.py index 675e985..cec1f7f 100644 --- a/arguments/dynerf/flame_steak.py +++ b/arguments/dynerf/flame_steak.py @@ -1,4 +1,5 @@ _base_ = './default.py' OptimizationParams = dict( + batch_size=2, ) \ No newline at end of file diff --git a/arguments/dynerf/sear_steak.py b/arguments/dynerf/sear_steak.py index 675e985..b1c5962 100644 --- a/arguments/dynerf/sear_steak.py +++ b/arguments/dynerf/sear_steak.py @@ -1,4 +1,4 @@ _base_ = './default.py' OptimizationParams = dict( - + batch_size=2, ) \ No newline at end of file diff --git a/arguments/hypernerf/default.py b/arguments/hypernerf/default.py index 4412b74..39035e4 100644 --- a/arguments/hypernerf/default.py +++ b/arguments/hypernerf/default.py @@ -11,7 +11,7 @@ ModelHiddenParams = dict( plane_tv_weight = 0.0002, time_smoothness_weight = 0.001, l1_time_planes = 0.0001, - render_process=False + render_process=True ) OptimizationParams = dict( # dataloader=True, diff --git a/gaussian_renderer/__init__.py b/gaussian_renderer/__init__.py index 80a33da..6c1605d 100644 --- a/gaussian_renderer/__init__.py +++ b/gaussian_renderer/__init__.py @@ -77,7 +77,7 @@ def render(viewpoint_camera, pc : GaussianModel, pipe, bg_color : torch.Tensor, scales = pc._scaling rotations = pc._rotation deformation_point = pc._deformation_table - if stage == "coarse" : + if "coarse" in stage: means3D_final, scales_final, rotations_final, opacity_final, shs_final = means3D, scales, rotations, opacity, shs else: # time0 = get_time() diff --git a/scene/deformation.py b/scene/deformation.py index 024565b..b87ffce 100644 --- a/scene/deformation.py +++ b/scene/deformation.py @@ -24,7 +24,7 @@ class Deformation(nn.Module): self.grid_pe = grid_pe self.no_grid = args.no_grid self.grid = HexPlaneField(args.bounds, args.kplanes_config, args.multires) - + # breakpoint() self.args = args # self.args.empty_voxel=True if self.args.empty_voxel: diff --git a/scene/hyper_loader.py b/scene/hyper_loader.py index 45f000b..7865e98 100644 --- a/scene/hyper_loader.py +++ b/scene/hyper_loader.py @@ -103,8 +103,9 @@ class Load_hyper_data(Dataset): self.image_mask = [f'{datadir}/covisible/{int(2)}x/val/{i}.png' for i in self.all_img_origin] else: self.image_mask = None - self.generate_video_path() - + + # self.generate_video_path() + # self.i_test def generate_video_path(self): self.select_video_cams = [item for i, item in enumerate(self.all_cam_params) if i % 1 == 0 ] @@ -120,14 +121,14 @@ class Load_hyper_data(Dataset): elif self.split == "test": return self.load_raw(self.i_test[index]) elif self.split == "video": - return self.load_video(index) + return self.load_raw(index) def __len__(self): if self.split == "train": return len(self.i_train) elif self.split == "test": return len(self.i_test) elif self.split == "video": - return len(self.video_path) + return len(self.i_test) # return len(self.video_v2) def load_video(self, idx): if idx in self.map.keys(): diff --git a/scripts/process_dnerf.sh b/scripts/process_dnerf.sh index e417d07..a391e91 100644 --- a/scripts/process_dnerf.sh +++ b/scripts/process_dnerf.sh @@ -39,4 +39,4 @@ wait export CUDA_VISIBLE_DEVICES=2&&python metrics.py --model_path "output/$exp_name1/bouncingballs/" & export CUDA_VISIBLE_DEVICES=0&&python metrics.py --model_path "output/$exp_name1/lego/" wait -echo "Done" +echo "Done" \ No newline at end of file diff --git a/scripts/read_all_metrics.py b/scripts/read_all_metrics.py index e81fc95..66c42d9 100644 --- a/scripts/read_all_metrics.py +++ b/scripts/read_all_metrics.py @@ -1,10 +1,8 @@ import json import os -# exp_name = ["dnerf_tv_nodx","dnerf_tv_nodr","dnerf_tv_nods","dnerf_tv","dnerf_tv_dshs","dnerf_tv_do", - # "dnerf_tv_2","dnerf_tv_8","dnerf_tv_deepmlp"] -# exp_name= ["dnerf_tv_2_slim"] -exp_name=["dynerf_default","dynerf_9"] -# exp_name = ["hypernerf_3dgs"] +# exp_name = ["hypernerf"] +# exp_name= ["dnerf"] +exp_name=["dynerf"] scene_name = ["coffee_martini", "cook_spinach", "cut_roasted_beef", "flame_salmon_1", "flame_steak", "sear_steak"] # scene_name = ["bouncingballs","jumpingjacks","lego","standup","hook","mutant","hellwarrior","trex"] # scene_name = ["3dprinter","broom2","peel-banana","vrig-chicken"] @@ -18,8 +16,6 @@ for scene in scene_name: load_path = os.path.join("output",experiment,scene,json_name) with open(load_path) as f: js = json.load(f) - # print(js) - # print(scene, experiment, js["ours_20000"]) for res in ["ours_30000","ours_20000","ours_14000","ours_10000","ours_7000","ours_3000"]: if res in js.keys(): for key, item in js[res].items(): diff --git a/scripts/train_dnerf.sh b/scripts/train_dnerf.sh index 8ffaeeb..1648fa1 100644 --- a/scripts/train_dnerf.sh +++ b/scripts/train_dnerf.sh @@ -12,4 +12,4 @@ wait export CUDA_VISIBLE_DEVICES=2&&python train.py -s data/dnerf/hook --port 6069 --expname "$exp_name1/hook" --configs arguments/$exp_name1/hook.py & export CUDA_VISIBLE_DEVICES=3&&python train.py -s data/dnerf/hellwarrior --port 6070 --expname "$exp_name1/hellwarrior" --configs arguments/$exp_name1/hellwarrior.py & wait -echo "Done" +echo "Done" \ No newline at end of file diff --git a/scripts/train_dycheck.sh b/scripts/train_dycheck.sh index c6019b8..cdd9613 100644 --- a/scripts/train_dycheck.sh +++ b/scripts/train_dycheck.sh @@ -18,4 +18,4 @@ export CUDA_VISIBLE_DEVICES=2&&python metrics.py --model_path output/$exp_name1/ export CUDA_VISIBLE_DEVICES=3&&python metrics.py --model_path output/$exp_name1/teddy/ & export CUDA_VISIBLE_DEVICES=2&&python metrics.py --model_path output/$exp_name1/space-out/ & export CUDA_VISIBLE_DEVICES=3&&python metrics.py --model_path output/$exp_name1/spin/ -echo "Done" +echo "Done" \ No newline at end of file diff --git a/train.py b/train.py index 2d3b2f9..973f822 100644 --- a/train.py +++ b/train.py @@ -86,10 +86,10 @@ def scene_reconstruction(dataset, opt, hyper, pipe, testing_iterations, saving_i viewpoint_stack = scene.getTrainCameras() if opt.custom_sampler is not None: sampler = FineSampler(viewpoint_stack) - viewpoint_stack_loader = DataLoader(viewpoint_stack, batch_size=batch_size,sampler=sampler,num_workers=32,collate_fn=list) + viewpoint_stack_loader = DataLoader(viewpoint_stack, batch_size=batch_size,sampler=sampler,num_workers=16,collate_fn=list) random_loader = False else: - viewpoint_stack_loader = DataLoader(viewpoint_stack, batch_size=batch_size,shuffle=True,num_workers=32,collate_fn=list) + viewpoint_stack_loader = DataLoader(viewpoint_stack, batch_size=batch_size,shuffle=True,num_workers=16,collate_fn=list) random_loader = True loader = iter(viewpoint_stack_loader)