MCPcopy Create free account
hub / github.com/Anttwo/SuGaR / __init__

Method __init__

gsplat_wrapper/rasterization.py:49–75  ·  view source on GitHub ↗
(self, raster_settings)

Source from the content-addressed store, hash-verified

47
48class GaussianRasterizer(nn.Module):
49 def __init__(self, raster_settings):
50 super(GaussianRasterizer, self).__init__()
51 self.raster_settings = raster_settings
52
53 self.image_height = raster_settings.image_height
54 self.image_width = raster_settings.image_width
55 self.tanfovx = raster_settings.tanfovx
56 self.tanfovy = raster_settings.tanfovy
57 self.bg = raster_settings.bg
58 self.scale_modifier = raster_settings.scale_modifier
59 self.viewmatrix = raster_settings.viewmatrix
60 self.projmatrix = raster_settings.projmatrix
61 self.sh_degree = raster_settings.sh_degree
62 self.campos = raster_settings.campos
63 self.prefiltered = raster_settings.prefiltered
64 self.debug = raster_settings.debug
65
66 self.fx = fov2focal(2. * math.atan(self.tanfovx), self.image_width)
67 self.fy = fov2focal(2. * math.atan(self.tanfovy), self.image_height)
68
69 self.K = get_intrinsics_for_gsplat(
70 self.fx, self.fy,
71 self.image_width, self.image_height
72 )[None].to(self.viewmatrix.device)
73
74 if len(self.bg.shape) == 1:
75 self.bg = self.bg[None].repeat(self.K.shape[0], 1)
76
77 def forward(
78 self, means3D, means2D,

Callers

nothing calls this directly

Calls 3

fov2focalFunction · 0.70
toMethod · 0.45

Tested by

no test coverage detected