pub struct Gaussian3dScene<B>where
B: Backend,{
pub colors_sh: Param<Tensor<B, 2>>,
pub opacities: Param<Tensor<B, 2>>,
pub positions: Param<Tensor<B, 2>>,
pub rotations: Param<Tensor<B, 2>>,
pub scalings: Param<Tensor<B, 2>>,
}
Expand description
3DGS representation.
Fields§
§colors_sh: Param<Tensor<B, 2>>
Colors in SH space. (Inner value)
The shape is [P, M * 3]
, which derives from [P, M, 3]
.
P
isSelf::point_count
.M
isSH_COUNT_MAX
.
It is represented as orthonormalized spherical harmonic with RGB channels.
opacities: Param<Tensor<B, 2>>
Opacities. (Inner value)
The shape is [P, 1]
.
positions: Param<Tensor<B, 2>>
3D Positions. (Inner value)
The shape is [P, 3]
.
rotations: Param<Tensor<B, 2>>
Rotations. (Inner value)
The shape is [P, 4]
.
They are represented as Hamilton quaternions in scalar-last order,
i.e., [x, y, z, w]
.
scalings: Param<Tensor<B, 2>>
3D scalings. (Inner value)
The shape is [P, 3]
.
Implementations§
source§impl<B> Gaussian3dScene<B>where
B: Backend,
impl<B> Gaussian3dScene<B>where
B: Backend,
Scene exporters
source§impl<B> Gaussian3dScene<B>where
B: Backend,
impl<B> Gaussian3dScene<B>where
B: Backend,
Scene importers
sourcepub fn decode_polygon(
reader: &mut impl Read,
device: &<B as Backend>::Device,
) -> Result<Gaussian3dScene<B>, Error>
pub fn decode_polygon( reader: &mut impl Read, device: &<B as Backend>::Device, ) -> Result<Gaussian3dScene<B>, Error>
Import the scene in the 3DGS PLY format.
sourcepub fn from_points(
points: Vec<Point>,
device: &<B as Backend>::Device,
) -> Gaussian3dScene<B>
pub fn from_points( points: Vec<Point>, device: &<B as Backend>::Device, ) -> Gaussian3dScene<B>
Import the scene from the point cloud.
source§impl<B> Gaussian3dScene<B>where
B: Backend,
impl<B> Gaussian3dScene<B>where
B: Backend,
Outer property value getters
sourcepub fn get_colors_sh(&self) -> Tensor<B, 2>
pub fn get_colors_sh(&self) -> Tensor<B, 2>
Colors in SH space. (Outer value)
The shape is [P, M * 3]
, which derives from [P, M, 3]
.
P
isSelf::point_count
.M
isSH_COUNT_MAX
.
It is represented as orthonormalized spherical harmonic with RGB channels.
sourcepub fn get_opacities(&self) -> Tensor<B, 2>
pub fn get_opacities(&self) -> Tensor<B, 2>
Opacities. (Outer value)
The shape is [P, 1]
.
They range from 0.0
to 1.0
.
sourcepub fn get_positions(&self) -> Tensor<B, 2>
pub fn get_positions(&self) -> Tensor<B, 2>
3D Positions. (Outer value)
The shape is [P, 3]
.
sourcepub fn get_rotations(&self) -> Tensor<B, 2>
pub fn get_rotations(&self) -> Tensor<B, 2>
Rotations. (Outer value)
The shape is [P, 4]
.
They are represented as normalized Hamilton quaternions in scalar-last order,
i.e., [x, y, z, w]
.
sourcepub fn get_scalings(&self) -> Tensor<B, 2>
pub fn get_scalings(&self) -> Tensor<B, 2>
3D scalings. (Outer value)
The shape is [P, 3]
.
source§impl<B> Gaussian3dScene<B>where
B: Backend,
impl<B> Gaussian3dScene<B>where
B: Backend,
Outer property value makers
sourcepub fn make_colors_sh(colors_sh: Tensor<B, 2>) -> Tensor<B, 2>
pub fn make_colors_sh(colors_sh: Tensor<B, 2>) -> Tensor<B, 2>
Making values for Gaussian3dScene::get_colors_sh
sourcepub fn make_opacities(opacities: Tensor<B, 2>) -> Tensor<B, 2>
pub fn make_opacities(opacities: Tensor<B, 2>) -> Tensor<B, 2>
Making values for Gaussian3dScene::get_opacities
sourcepub fn make_positions(positions: Tensor<B, 2>) -> Tensor<B, 2>
pub fn make_positions(positions: Tensor<B, 2>) -> Tensor<B, 2>
Making values for Gaussian3dScene::get_positions
sourcepub fn make_rotations(rotations: Tensor<B, 2>) -> Tensor<B, 2>
pub fn make_rotations(rotations: Tensor<B, 2>) -> Tensor<B, 2>
Making values for Gaussian3dScene::get_rotations
sourcepub fn make_scalings(scalings: Tensor<B, 2>) -> Tensor<B, 2>
pub fn make_scalings(scalings: Tensor<B, 2>) -> Tensor<B, 2>
Making values for Gaussian3dScene::get_scalings
source§impl<B> Gaussian3dScene<B>where
B: Backend,
impl<B> Gaussian3dScene<B>where
B: Backend,
Outer property value setters
sourcepub fn set_colors_sh(
&mut self,
colors_sh: Tensor<B, 2>,
) -> &mut Gaussian3dScene<B>
pub fn set_colors_sh( &mut self, colors_sh: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>
Setting values for Gaussian3dScene::get_colors_sh
sourcepub fn set_opacities(
&mut self,
opacities: Tensor<B, 2>,
) -> &mut Gaussian3dScene<B>
pub fn set_opacities( &mut self, opacities: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>
Setting values for Gaussian3dScene::get_opacities
sourcepub fn set_positions(
&mut self,
positions: Tensor<B, 2>,
) -> &mut Gaussian3dScene<B>
pub fn set_positions( &mut self, positions: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>
Setting values for Gaussian3dScene::get_positions
sourcepub fn set_rotations(
&mut self,
rotations: Tensor<B, 2>,
) -> &mut Gaussian3dScene<B>
pub fn set_rotations( &mut self, rotations: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>
Setting values for Gaussian3dScene::get_rotations
sourcepub fn set_scalings(
&mut self,
scalings: Tensor<B, 2>,
) -> &mut Gaussian3dScene<B>
pub fn set_scalings( &mut self, scalings: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>
Setting values for Gaussian3dScene::get_scalings
source§impl<B> Gaussian3dScene<B>where
B: Backend,
impl<B> Gaussian3dScene<B>where
B: Backend,
Inner property value makers
sourcepub fn make_inner_colors_sh(colors_sh: Tensor<B, 2>) -> Tensor<B, 2>
pub fn make_inner_colors_sh(colors_sh: Tensor<B, 2>) -> Tensor<B, 2>
Making values for Gaussian3dScene::colors_sh
sourcepub fn make_inner_opacities(opacities: Tensor<B, 2>) -> Tensor<B, 2>
pub fn make_inner_opacities(opacities: Tensor<B, 2>) -> Tensor<B, 2>
Making values for Gaussian3dScene::opacities
sourcepub fn make_inner_positions(positions: Tensor<B, 2>) -> Tensor<B, 2>
pub fn make_inner_positions(positions: Tensor<B, 2>) -> Tensor<B, 2>
Making values for Gaussian3dScene::positions
sourcepub fn make_inner_rotations(rotations: Tensor<B, 2>) -> Tensor<B, 2>
pub fn make_inner_rotations(rotations: Tensor<B, 2>) -> Tensor<B, 2>
Making values for Gaussian3dScene::rotations
sourcepub fn make_inner_scalings(scalings: Tensor<B, 2>) -> Tensor<B, 2>
pub fn make_inner_scalings(scalings: Tensor<B, 2>) -> Tensor<B, 2>
Making values for Gaussian3dScene::scalings
source§impl<B> Gaussian3dScene<B>where
B: Backend,
impl<B> Gaussian3dScene<B>where
B: Backend,
Inner property value setters
sourcepub fn set_inner_colors_sh(
&mut self,
colors_sh: Tensor<B, 2>,
) -> &mut Gaussian3dScene<B>
pub fn set_inner_colors_sh( &mut self, colors_sh: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>
Setting inner values for Gaussian3dScene::colors_sh
sourcepub fn set_inner_opacities(
&mut self,
opacities: Tensor<B, 2>,
) -> &mut Gaussian3dScene<B>
pub fn set_inner_opacities( &mut self, opacities: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>
Setting inner values for Gaussian3dScene::opacities
sourcepub fn set_inner_positions(
&mut self,
positions: Tensor<B, 2>,
) -> &mut Gaussian3dScene<B>
pub fn set_inner_positions( &mut self, positions: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>
Setting inner values for Gaussian3dScene::positions
sourcepub fn set_inner_rotations(
&mut self,
rotations: Tensor<B, 2>,
) -> &mut Gaussian3dScene<B>
pub fn set_inner_rotations( &mut self, rotations: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>
Setting inner values for Gaussian3dScene::rotations
sourcepub fn set_inner_scalings(
&mut self,
scalings: Tensor<B, 2>,
) -> &mut Gaussian3dScene<B>
pub fn set_inner_scalings( &mut self, scalings: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>
Setting inner values for Gaussian3dScene::scalings
source§impl<B> Gaussian3dScene<B>where
B: Backend,
impl<B> Gaussian3dScene<B>where
B: Backend,
Attribute getters
source§impl<B> Gaussian3dScene<B>
impl<B> Gaussian3dScene<B>
sourcepub fn render(
&self,
view: &View,
options: &Gaussian3dRenderOptions,
) -> Result<Gaussian3dRenderOutput<B>, Error>
pub fn render( &self, view: &View, options: &Gaussian3dRenderOptions, ) -> Result<Gaussian3dRenderOutput<B>, Error>
Render the 3DGS scene.
It renders an image with the given view
.
source§impl<B> Gaussian3dScene<Autodiff<B>>
impl<B> Gaussian3dScene<Autodiff<B>>
sourcepub fn render(
&self,
view: &View,
options: &Gaussian3dRenderOptions,
) -> Result<Gaussian3dRenderOutputAutodiff<Autodiff<B>>, Error>
pub fn render( &self, view: &View, options: &Gaussian3dRenderOptions, ) -> Result<Gaussian3dRenderOutputAutodiff<Autodiff<B>>, Error>
Render the 3DGS scene with autodiff enabled.
It renders a learnable image with the given view
.
Trait Implementations§
source§impl<B> AutodiffModule<B> for Gaussian3dScene<B>
impl<B> AutodiffModule<B> for Gaussian3dScene<B>
source§type InnerModule = Gaussian3dScene<<B as AutodiffBackend>::InnerBackend>
type InnerModule = Gaussian3dScene<<B as AutodiffBackend>::InnerBackend>
source§fn valid(&self) -> <Gaussian3dScene<B> as AutodiffModule<B>>::InnerModule
fn valid(&self) -> <Gaussian3dScene<B> as AutodiffModule<B>>::InnerModule
source§impl<B> Clone for Gaussian3dScene<B>where
B: Backend,
impl<B> Clone for Gaussian3dScene<B>where
B: Backend,
source§fn clone(&self) -> Gaussian3dScene<B>
fn clone(&self) -> Gaussian3dScene<B>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<B> Debug for Gaussian3dScene<B>where
B: Backend,
impl<B> Debug for Gaussian3dScene<B>where
B: Backend,
source§impl<B> Default for Gaussian3dScene<B>where
B: Backend,
impl<B> Default for Gaussian3dScene<B>where
B: Backend,
source§fn default() -> Gaussian3dScene<B>
fn default() -> Gaussian3dScene<B>
source§impl<B> Display for Gaussian3dScene<B>where
B: Backend,
impl<B> Display for Gaussian3dScene<B>where
B: Backend,
source§impl<R, F, I, B> Gaussian3dRenderer<JitBackend<R, F, I, B>> for Gaussian3dScene<Autodiff<JitBackend<R, F, I, B>>>
impl<R, F, I, B> Gaussian3dRenderer<JitBackend<R, F, I, B>> for Gaussian3dScene<Autodiff<JitBackend<R, F, I, B>>>
source§fn render_forward(
input: RenderInput<JitBackend<R, F, I, B>>,
view: &View,
options: &Gaussian3dRenderOptions,
) -> Result<RenderOutput<JitBackend<R, F, I, B>>, Error>
fn render_forward( input: RenderInput<JitBackend<R, F, I, B>>, view: &View, options: &Gaussian3dRenderOptions, ) -> Result<RenderOutput<JitBackend<R, F, I, B>>, Error>
source§fn render_backward(
state: RenderInput<JitBackend<R, F, I, B>>,
colors_rgb_2d_grad: <JitBackend<R, F, I, B> as Backend>::FloatTensorPrimitive,
) -> RenderOutput<JitBackend<R, F, I, B>>
fn render_backward( state: RenderInput<JitBackend<R, F, I, B>>, colors_rgb_2d_grad: <JitBackend<R, F, I, B> as Backend>::FloatTensorPrimitive, ) -> RenderOutput<JitBackend<R, F, I, B>>
source§impl<R, F, I, B> Gaussian3dRenderer<JitBackend<R, F, I, B>> for Gaussian3dScene<JitBackend<R, F, I, B>>
impl<R, F, I, B> Gaussian3dRenderer<JitBackend<R, F, I, B>> for Gaussian3dScene<JitBackend<R, F, I, B>>
source§fn render_forward(
input: RenderInput<JitBackend<R, F, I, B>>,
view: &View,
options: &Gaussian3dRenderOptions,
) -> Result<RenderOutput<JitBackend<R, F, I, B>>, Error>
fn render_forward( input: RenderInput<JitBackend<R, F, I, B>>, view: &View, options: &Gaussian3dRenderOptions, ) -> Result<RenderOutput<JitBackend<R, F, I, B>>, Error>
source§fn render_backward(
state: RenderInput<JitBackend<R, F, I, B>>,
colors_rgb_2d_grad: <JitBackend<R, F, I, B> as Backend>::FloatTensorPrimitive,
) -> RenderOutput<JitBackend<R, F, I, B>>
fn render_backward( state: RenderInput<JitBackend<R, F, I, B>>, colors_rgb_2d_grad: <JitBackend<R, F, I, B> as Backend>::FloatTensorPrimitive, ) -> RenderOutput<JitBackend<R, F, I, B>>
source§impl<B> Module<B> for Gaussian3dScene<B>where
B: Backend,
impl<B> Module<B> for Gaussian3dScene<B>where
B: Backend,
source§type Record = Gaussian3dSceneRecord<B>
type Record = Gaussian3dSceneRecord<B>
source§fn load_record(
self,
record: <Gaussian3dScene<B> as Module<B>>::Record,
) -> Gaussian3dScene<B>
fn load_record( self, record: <Gaussian3dScene<B> as Module<B>>::Record, ) -> Gaussian3dScene<B>
source§fn into_record(self) -> <Gaussian3dScene<B> as Module<B>>::Record
fn into_record(self) -> <Gaussian3dScene<B> as Module<B>>::Record
source§fn num_params(&self) -> usize
fn num_params(&self) -> usize
source§fn visit<Visitor>(&self, visitor: &mut Visitor)where
Visitor: ModuleVisitor<B>,
fn visit<Visitor>(&self, visitor: &mut Visitor)where
Visitor: ModuleVisitor<B>,
source§fn map<Mapper>(self, mapper: &mut Mapper) -> Gaussian3dScene<B>where
Mapper: ModuleMapper<B>,
fn map<Mapper>(self, mapper: &mut Mapper) -> Gaussian3dScene<B>where
Mapper: ModuleMapper<B>,
source§fn collect_devices(
&self,
devices: Vec<<B as Backend>::Device>,
) -> Vec<<B as Backend>::Device>
fn collect_devices( &self, devices: Vec<<B as Backend>::Device>, ) -> Vec<<B as Backend>::Device>
source§fn to_device(self, device: &<B as Backend>::Device) -> Gaussian3dScene<B>
fn to_device(self, device: &<B as Backend>::Device) -> Gaussian3dScene<B>
source§fn fork(self, device: &<B as Backend>::Device) -> Gaussian3dScene<B>
fn fork(self, device: &<B as Backend>::Device) -> Gaussian3dScene<B>
§fn devices(&self) -> Vec<<B as Backend>::Device>
fn devices(&self) -> Vec<<B as Backend>::Device>
§fn save_file<FR, PB>(
self,
file_path: PB,
recorder: &FR,
) -> Result<(), RecorderError>
fn save_file<FR, PB>( self, file_path: PB, recorder: &FR, ) -> Result<(), RecorderError>
§fn load_file<FR, PB>(
self,
file_path: PB,
recorder: &FR,
device: &<B as Backend>::Device,
) -> Result<Self, RecorderError>
fn load_file<FR, PB>( self, file_path: PB, recorder: &FR, device: &<B as Backend>::Device, ) -> Result<Self, RecorderError>
§fn quantize_weights<C>(self, quantizer: &mut Quantizer<C>) -> Selfwhere
C: Calibration,
fn quantize_weights<C>(self, quantizer: &mut Quantizer<C>) -> Selfwhere
C: Calibration,
source§impl<B> ModuleDisplay for Gaussian3dScene<B>where
B: Backend,
impl<B> ModuleDisplay for Gaussian3dScene<B>where
B: Backend,
§fn format(&self, passed_settings: DisplaySettings) -> String
fn format(&self, passed_settings: DisplaySettings) -> String
§fn custom_settings(&self) -> Option<DisplaySettings>
fn custom_settings(&self) -> Option<DisplaySettings>
§fn custom_content(&self, _content: Content) -> Option<Content>
fn custom_content(&self, _content: Content) -> Option<Content>
Auto Trait Implementations§
impl<B> !Freeze for Gaussian3dScene<B>
impl<B> !RefUnwindSafe for Gaussian3dScene<B>
impl<B> Send for Gaussian3dScene<B>
impl<B> !Sync for Gaussian3dScene<B>
impl<B> Unpin for Gaussian3dScene<B>where
<B as Backend>::FloatTensorPrimitive: Unpin,
<B as Backend>::QuantizedTensorPrimitive: Unpin,
<B as Backend>::Device: Unpin,
impl<B> UnwindSafe for Gaussian3dScene<B>where
<B as Backend>::FloatTensorPrimitive: UnwindSafe,
<B as Backend>::QuantizedTensorPrimitive: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more