mirror of
https://github.com/graphdeco-inria/gaussian-splatting
synced 2024-11-22 08:18:17 +00:00
added __repr__ to Camera()
This commit is contained in:
parent
27ef163bdf
commit
f934e701b2
@ -56,6 +56,16 @@ class Camera(nn.Module):
|
||||
self.full_proj_transform = (self.world_view_transform.unsqueeze(0).bmm(self.projection_matrix.unsqueeze(0))).squeeze(0)
|
||||
self.camera_center = self.world_view_transform.inverse()[3, :3]
|
||||
|
||||
def __repr__(self):
|
||||
format_string = self.__class__.__name__ + '()\n'
|
||||
for k, v in self.__dict__.items():
|
||||
if torch.is_tensor(v) and v.numel() > 16:
|
||||
format_string +=f" {k}:\t{tuple(v.shape)}\n"
|
||||
else:
|
||||
format_string += f"{k}:\t{v}\n"
|
||||
return format_string
|
||||
|
||||
|
||||
class MiniCam:
|
||||
def __init__(self, width, height, fovy, fovx, znear, zfar, world_view_transform, full_proj_transform):
|
||||
self.image_width = width
|
||||
|
@ -60,7 +60,7 @@ class GaussianModel:
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
format_string = self.__class__.__name__ + '()'
|
||||
format_string = self.__class__.__name__ + '()\n'
|
||||
for k, v in self.__dict__.items():
|
||||
if torch.is_tensor(v):
|
||||
format_string +=f" {k}:\t{tuple(v.shape)}\n"
|
||||
@ -84,7 +84,7 @@ class GaussianModel:
|
||||
self.optimizer.state_dict(),
|
||||
self.spatial_lr_scale,
|
||||
)
|
||||
|
||||
|
||||
def restore(self, model_args, training_args):
|
||||
(self.active_sh_degree,
|
||||
self._xyz,
|
||||
|
Loading…
Reference in New Issue
Block a user