MCPcopy Create free account
hub / github.com/OpenImagingLab/4DSloMo / densification_postfix

Method densification_postfix

scene/gaussian_model.py:449–479  ·  view source on GitHub ↗
(self, new_xyz, new_features_dc, new_features_rest, new_opacities, new_scaling, new_rotation, new_t, new_scaling_t, new_rotation_r)

Source from the content-addressed store, hash-verified

447 return optimizable_tensors
448
449 def densification_postfix(self, new_xyz, new_features_dc, new_features_rest, new_opacities, new_scaling, new_rotation, new_t, new_scaling_t, new_rotation_r):
450 d = {"xyz": new_xyz,
451 "f_dc": new_features_dc,
452 "f_rest": new_features_rest,
453 "opacity": new_opacities,
454 "scaling" : new_scaling,
455 "rotation" : new_rotation,
456 }
457 if self.gaussian_dim == 4:
458 d["t"] = new_t
459 d["scaling_t"] = new_scaling_t
460 if self.rot_4d:
461 d["rotation_r"] = new_rotation_r
462
463 optimizable_tensors = self.cat_tensors_to_optimizer(d)
464 self._xyz = optimizable_tensors["xyz"]
465 self._features_dc = optimizable_tensors["f_dc"]
466 self._features_rest = optimizable_tensors["f_rest"]
467 self._opacity = optimizable_tensors["opacity"]
468 self._scaling = optimizable_tensors["scaling"]
469 self._rotation = optimizable_tensors["rotation"]
470 if self.gaussian_dim == 4:
471 self._t = optimizable_tensors['t']
472 self._scaling_t = optimizable_tensors['scaling_t']
473 if self.rot_4d:
474 self._rotation_r = optimizable_tensors['rotation_r']
475 self.t_gradient_accum = torch.zeros((self.get_xyz.shape[0], 1), device="cuda")
476
477 self.xyz_gradient_accum = torch.zeros((self.get_xyz.shape[0], 1), device="cuda")
478 self.denom = torch.zeros((self.get_xyz.shape[0], 1), device="cuda")
479 self.max_radii2D = torch.zeros((self.get_xyz.shape[0]), device="cuda")
480
481 def densify_and_split(self, grads, grad_threshold, scene_extent, grads_t, grad_t_threshold, N=2):
482 n_init_points = self.get_xyz.shape[0]

Callers 2

densify_and_splitMethod · 0.95
densify_and_cloneMethod · 0.95

Calls 1

Tested by

no test coverage detected