Skip to content

Commit 598caf8

Browse files
committed
fix copilot
Signed-off-by: Francis Williams <francis@fwilliams.info>
1 parent 53ba8c1 commit 598caf8

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

src/fvdb/GaussianSplat3d.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ GaussianSplat3d::projectGaussiansForCameraImpl(
469469
RenderSettings settingsForProjection = settings;
470470

471471
if (resolvedProjectionMethod == ProjectionMethod::ANALYTIC) {
472-
auto ret =
473-
projectGaussiansImpl(worldToCameraMatrices, projectionMatrices, settingsForProjection, cameraModel);
472+
auto ret = projectGaussiansImpl(
473+
worldToCameraMatrices, projectionMatrices, settingsForProjection, cameraModel);
474474
ret.mCameraModel = cameraModel;
475475
ret.mProjectionMethod = resolvedProjectionMethod;
476476
return ret;
@@ -810,8 +810,11 @@ GaussianSplat3d::sparseProjectGaussiansForCameraImpl(
810810
RenderSettings settingsForProjection = settings;
811811

812812
if (resolvedProjectionMethod == ProjectionMethod::ANALYTIC) {
813-
auto ret = sparseProjectGaussiansImpl(
814-
pixelsToRender, worldToCameraMatrices, projectionMatrices, settingsForProjection, cameraModel);
813+
auto ret = sparseProjectGaussiansImpl(pixelsToRender,
814+
worldToCameraMatrices,
815+
projectionMatrices,
816+
settingsForProjection,
817+
cameraModel);
815818
ret.mCameraModel = cameraModel;
816819
ret.mProjectionMethod = resolvedProjectionMethod;
817820
return ret;
@@ -1486,6 +1489,7 @@ GaussianSplat3d::renderDepths(const torch::Tensor &worldToCameraMatrices,
14861489
settings.shDegreeToUse = -1;
14871490
settings.radiusClip = minRadius2d;
14881491
settings.eps2d = eps2d;
1492+
settings.antialias = antialias;
14891493
settings.tileSize = tileSize;
14901494
settings.renderMode = RenderSettings::RenderMode::DEPTH;
14911495

@@ -1595,6 +1599,7 @@ GaussianSplat3d::renderNumContributingGaussians(
15951599
settings.tileSize = tileSize;
15961600
settings.radiusClip = minRadius2d;
15971601
settings.eps2d = eps2d;
1602+
settings.antialias = antialias;
15981603
settings.renderMode = RenderSettings::RenderMode::DEPTH;
15991604

16001605
return renderNumContributingGaussiansImpl(worldToCameraMatrices,
@@ -1631,6 +1636,7 @@ GaussianSplat3d::sparseRenderDepths(const fvdb::JaggedTensor &pixelsToRender,
16311636
settings.tileSize = tileSize;
16321637
settings.radiusClip = minRadius2d;
16331638
settings.eps2d = eps2d;
1639+
settings.antialias = antialias;
16341640
settings.renderMode = RenderSettings::RenderMode::DEPTH;
16351641

16361642
return sparseRenderImpl(pixelsToRender,
@@ -1671,6 +1677,7 @@ GaussianSplat3d::sparseRenderImages(const fvdb::JaggedTensor &pixelsToRender,
16711677
settings.tileSize = tileSize;
16721678
settings.radiusClip = minRadius2d;
16731679
settings.eps2d = eps2d;
1680+
settings.antialias = antialias;
16741681
settings.renderMode = RenderSettings::RenderMode::RGB;
16751682

16761683
return sparseRenderImpl(pixelsToRender,
@@ -1711,6 +1718,7 @@ GaussianSplat3d::sparseRenderImagesAndDepths(const fvdb::JaggedTensor &pixelsToR
17111718
settings.tileSize = tileSize;
17121719
settings.radiusClip = minRadius2d;
17131720
settings.eps2d = eps2d;
1721+
settings.antialias = antialias;
17141722
settings.renderMode = RenderSettings::RenderMode::RGBD;
17151723

17161724
return sparseRenderImpl(pixelsToRender,
@@ -1749,6 +1757,7 @@ GaussianSplat3d::sparseRenderNumContributingGaussians(
17491757
settings.tileSize = tileSize;
17501758
settings.radiusClip = minRadius2d;
17511759
settings.eps2d = eps2d;
1760+
settings.antialias = antialias;
17521761
settings.renderMode = RenderSettings::RenderMode::DEPTH;
17531762

17541763
return sparseRenderNumContributingGaussiansImpl(pixelsToRender,

src/fvdb/detail/viewer/Viewer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ Viewer::setCameraModel(const std::string &scene_name, GaussianSplat3d::CameraMod
371371
} else if (mode == GaussianSplat3d::CameraModel::ORTHOGRAPHIC) {
372372
mEditor.camera.config.is_orthographic = PNANOVDB_TRUE;
373373
} else {
374-
throw std::invalid_argument("Viewer currently only supports CameraModel::PINHOLE and ORTHOGRAPHIC");
374+
throw std::invalid_argument(
375+
"Viewer currently only supports CameraModel::PINHOLE and ORTHOGRAPHIC");
375376
}
376377

377378
updateCamera(scene_name);

tests/unit/test_gaussian_splat_3d.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4452,7 +4452,8 @@ def _structural_comparison_metrics(
44524452
"bbox_linf_err": float((projected_bbox - world_bbox).abs().max().item()),
44534453
"centroid_err": float(torch.linalg.norm(projected_centroid - world_centroid).item()),
44544454
"blurred_alpha_rmse": self._blurred_alpha_rmse(projected_alpha_2d, world_alpha_2d),
4455-
"depth_mean_rel_err": abs(float(projected_depth_mean.item()) - float(world_depth_mean.item())) / depth_scale,
4455+
"depth_mean_rel_err": abs(float(projected_depth_mean.item()) - float(world_depth_mean.item()))
4456+
/ depth_scale,
44564457
"blurred_rgb_rmse": self._blurred_rgb_rmse(
44574458
projected_rgbd[0, ..., :-1],
44584459
world_rgbd[0, ..., :-1],
@@ -4590,7 +4591,9 @@ def test_structural_projected_render_matches_from_world_for_medium_scene(self):
45904591
**render_args,
45914592
sh_degree_to_use=0,
45924593
)
4593-
rgbd_from_projection, alpha_from_projection = parity_gs3d.render_from_projected_gaussians(projected_rgbd)
4594+
rgbd_from_projection, alpha_from_projection = parity_gs3d.render_from_projected_gaussians(
4595+
projected_rgbd
4596+
)
45944597
rgbd_from_world, alpha_from_world = parity_gs3d.render_images_and_depths_from_world(
45954598
**render_args,
45964599
sh_degree_to_use=0,

0 commit comments

Comments
 (0)