| 27 | |
| 28 | |
| 29 | def initialize_resterize( |
| 30 | viewpoint_camera, |
| 31 | pc: GaussianModel, |
| 32 | pipe, |
| 33 | bg_color: torch.Tensor, |
| 34 | scaling_modifier=1.0, |
| 35 | ): |
| 36 | # Set up rasterization configuration |
| 37 | tanfovx = math.tan(viewpoint_camera.FoVx * 0.5) |
| 38 | tanfovy = math.tan(viewpoint_camera.FoVy * 0.5) |
| 39 | |
| 40 | raster_settings = GaussianRasterizationSettings( |
| 41 | image_height=int(viewpoint_camera.image_height), |
| 42 | image_width=int(viewpoint_camera.image_width), |
| 43 | tanfovx=tanfovx, |
| 44 | tanfovy=tanfovy, |
| 45 | bg=bg_color, |
| 46 | scale_modifier=scaling_modifier, |
| 47 | viewmatrix=viewpoint_camera.world_view_transform, |
| 48 | projmatrix=viewpoint_camera.full_proj_transform, |
| 49 | sh_degree=pc.active_sh_degree, |
| 50 | campos=viewpoint_camera.camera_center, |
| 51 | prefiltered=False, |
| 52 | debug=pipe.debug, |
| 53 | ) |
| 54 | |
| 55 | rasterize = GaussianRasterizer(raster_settings=raster_settings) |
| 56 | return rasterize |
| 57 | |
| 58 | |
| 59 | def load_params_from_gs( |