Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
diff-gaussian-rasterization
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alan de Oliveira
diff-gaussian-rasterization
Commits
8a219fd5
Commit
8a219fd5
authored
Jun 19, 2023
by
Bernhard Kerbl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes:
parent
64f7c223
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
rasterizer.py
diff_gaussian_rasterization/rasterizer.py
+14
-6
No files found.
diff_gaussian_rasterization/rasterizer.py
View file @
8a219fd5
...
...
@@ -13,6 +13,7 @@ def rasterize_gaussians(
rotations
,
cov3Ds_precomp
,
raster_settings
,
rasterizer_state
):
return
_RasterizeGaussians
.
apply
(
means3D
,
...
...
@@ -24,6 +25,7 @@ def rasterize_gaussians(
rotations
,
cov3Ds_precomp
,
raster_settings
,
rasterizer_state
)
class
_RasterizeGaussians
(
torch
.
autograd
.
Function
):
...
...
@@ -39,10 +41,9 @@ class _RasterizeGaussians(torch.autograd.Function):
rotations
,
cov3Ds_precomp
,
raster_settings
,
rasterizer_state
):
rasterizer_state
=
_C
.
create_rasterizer_state
()
# Restructure arguments the way that the C++ lib expects them
args
=
(
raster_settings
.
bg
,
...
...
@@ -115,10 +116,9 @@ class _RasterizeGaussians(torch.autograd.Function):
grad_rotations
,
grad_cov3Ds_precomp
,
None
,
None
,
)
_C
.
delete_rasterizer_state
(
rasterizer_state
)
return
grads
class
GaussianRasterizationSettings
(
NamedTuple
):
...
...
@@ -134,10 +134,17 @@ class GaussianRasterizationSettings(NamedTuple):
campos
:
torch
.
Tensor
prefiltered
:
bool
def
createRasterizerState
():
return
_C
.
create_rasterizer_state
()
def
deleteRasterizerState
(
state
):
return
_C
.
delete_rasterize_state
(
state
)
class
GaussianRasterizer
(
nn
.
Module
):
def
__init__
(
self
,
raster_settings
):
def
__init__
(
self
,
raster_settings
,
rasterizer_state
):
super
()
.
__init__
()
self
.
raster_settings
=
raster_settings
self
.
rasterizer_state
=
rasterizer_state
def
markVisible
(
self
,
positions
):
# Mark visible points (based on frustum culling for camera) with a boolean
...
...
@@ -151,8 +158,8 @@ class GaussianRasterizer(nn.Module):
return
visible
def
forward
(
self
,
means3D
,
means2D
,
opacities
,
shs
=
None
,
colors_precomp
=
None
,
scales
=
None
,
rotations
=
None
,
cov3D_precomp
=
None
):
raster_settings
=
self
.
raster_settings
rasterize_state
=
self
.
rasterizer_state
if
(
shs
is
None
and
colors_precomp
is
None
)
or
(
shs
is
not
None
and
colors_precomp
is
not
None
):
raise
Exception
(
'Please provide excatly one of either SHs or precomputed colors!'
)
...
...
@@ -183,5 +190,6 @@ class GaussianRasterizer(nn.Module):
rotations
,
cov3D_precomp
,
raster_settings
,
rasterize_state
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment