pub struct Gaussian3dScene<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].
PisSelf::point_count.MisSH_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: Backend> Gaussian3dScene<B>
impl<B: Backend> Gaussian3dScene<B>
Scene exporters
source§impl<B: Backend> Gaussian3dScene<B>
impl<B: Backend> Gaussian3dScene<B>
Scene importers
sourcepub fn decode_polygon(
reader: &mut impl Read,
device: &B::Device,
) -> Result<Self, Error>
pub fn decode_polygon( reader: &mut impl Read, device: &B::Device, ) -> Result<Self, Error>
Import the scene in the 3DGS PLY format.
sourcepub fn from_points(points: Points, device: &B::Device) -> Self
pub fn from_points(points: Points, device: &B::Device) -> Self
Import the scene from the point cloud.
source§impl<B: Backend> Gaussian3dScene<B>
impl<B: Backend> Gaussian3dScene<B>
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].
PisSelf::point_count.MisSH_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: Backend> Gaussian3dScene<B>
impl<B: Backend> Gaussian3dScene<B>
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: Backend> Gaussian3dScene<B>
impl<B: Backend> Gaussian3dScene<B>
Outer property value setters
sourcepub fn set_colors_sh(&mut self, colors_sh: Tensor<B, 2>) -> &mut Self
pub fn set_colors_sh(&mut self, colors_sh: Tensor<B, 2>) -> &mut Self
Setting values for Gaussian3dScene::get_colors_sh
sourcepub fn set_opacities(&mut self, opacities: Tensor<B, 2>) -> &mut Self
pub fn set_opacities(&mut self, opacities: Tensor<B, 2>) -> &mut Self
Setting values for Gaussian3dScene::get_opacities
sourcepub fn set_positions(&mut self, positions: Tensor<B, 2>) -> &mut Self
pub fn set_positions(&mut self, positions: Tensor<B, 2>) -> &mut Self
Setting values for Gaussian3dScene::get_positions
sourcepub fn set_rotations(&mut self, rotations: Tensor<B, 2>) -> &mut Self
pub fn set_rotations(&mut self, rotations: Tensor<B, 2>) -> &mut Self
Setting values for Gaussian3dScene::get_rotations
sourcepub fn set_scalings(&mut self, scalings: Tensor<B, 2>) -> &mut Self
pub fn set_scalings(&mut self, scalings: Tensor<B, 2>) -> &mut Self
Setting values for Gaussian3dScene::get_scalings
source§impl<B: Backend> Gaussian3dScene<B>
impl<B: Backend> Gaussian3dScene<B>
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: Backend> Gaussian3dScene<B>
impl<B: Backend> Gaussian3dScene<B>
Inner property value setters
sourcepub fn set_inner_colors_sh(&mut self, colors_sh: Tensor<B, 2>) -> &mut Self
pub fn set_inner_colors_sh(&mut self, colors_sh: Tensor<B, 2>) -> &mut Self
Setting inner values for Gaussian3dScene::colors_sh
sourcepub fn set_inner_opacities(&mut self, opacities: Tensor<B, 2>) -> &mut Self
pub fn set_inner_opacities(&mut self, opacities: Tensor<B, 2>) -> &mut Self
Setting inner values for Gaussian3dScene::opacities
sourcepub fn set_inner_positions(&mut self, positions: Tensor<B, 2>) -> &mut Self
pub fn set_inner_positions(&mut self, positions: Tensor<B, 2>) -> &mut Self
Setting inner values for Gaussian3dScene::positions
sourcepub fn set_inner_rotations(&mut self, rotations: Tensor<B, 2>) -> &mut Self
pub fn set_inner_rotations(&mut self, rotations: Tensor<B, 2>) -> &mut Self
Setting inner values for Gaussian3dScene::rotations
sourcepub fn set_inner_scalings(&mut self, scalings: Tensor<B, 2>) -> &mut Self
pub fn set_inner_scalings(&mut self, scalings: Tensor<B, 2>) -> &mut Self
Setting inner values for Gaussian3dScene::scalings
source§impl<B: Backend> Gaussian3dScene<B>
impl<B: Backend> Gaussian3dScene<B>
Attribute getters
source§impl<B: Backend> Gaussian3dScene<B>where
Self: Gaussian3dRenderer<B>,
impl<B: Backend> Gaussian3dScene<B>where
Self: Gaussian3dRenderer<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: Backend> Gaussian3dScene<Autodiff<B>>where
Self: Gaussian3dRenderer<B>,
impl<B: Backend> Gaussian3dScene<Autodiff<B>>where
Self: Gaussian3dRenderer<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) -> Self::InnerModule
fn valid(&self) -> Self::InnerModule
source§impl<B: Backend> Clone for Gaussian3dScene<B>
impl<B: Backend> Clone for Gaussian3dScene<B>
source§impl<B: Backend> Debug for Gaussian3dScene<B>
impl<B: Backend> Debug for Gaussian3dScene<B>
source§impl<B: Backend> Default for Gaussian3dScene<B>
impl<B: Backend> Default for Gaussian3dScene<B>
source§impl<B: Backend> Display for Gaussian3dScene<B>
impl<B: Backend> Display for Gaussian3dScene<B>
source§impl<R: JitRuntime, F: FloatElement, I: IntElement, B: BoolElement> Gaussian3dRenderer<JitBackend<R, F, I, B>> for Gaussian3dScene<Autodiff<JitBackend<R, F, I, B>>>
impl<R: JitRuntime, F: FloatElement, I: IntElement, B: BoolElement> 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: JitRuntime, F: FloatElement, I: IntElement, B: BoolElement> Gaussian3dRenderer<JitBackend<R, F, I, B>> for Gaussian3dScene<JitBackend<R, F, I, B>>
impl<R: JitRuntime, F: FloatElement, I: IntElement, B: BoolElement> 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: Backend> Module<B> for Gaussian3dScene<B>
impl<B: Backend> Module<B> for Gaussian3dScene<B>
source§type Record = Gaussian3dSceneRecord<B>
type Record = Gaussian3dSceneRecord<B>
source§fn load_record(self, record: Self::Record) -> Self
fn load_record(self, record: Self::Record) -> Self
source§fn into_record(self) -> Self::Record
fn into_record(self) -> Self::Record
source§fn num_params(&self) -> usize
fn num_params(&self) -> usize
source§fn visit<Visitor: ModuleVisitor<B>>(&self, visitor: &mut Visitor)
fn visit<Visitor: ModuleVisitor<B>>(&self, visitor: &mut Visitor)
source§fn map<Mapper: ModuleMapper<B>>(self, mapper: &mut Mapper) -> Self
fn map<Mapper: ModuleMapper<B>>(self, mapper: &mut Mapper) -> Self
source§fn collect_devices(&self, devices: Devices<B>) -> Devices<B>
fn collect_devices(&self, devices: Devices<B>) -> Devices<B>
source§fn to_device(self, device: &B::Device) -> Self
fn to_device(self, device: &B::Device) -> Self
source§fn fork(self, device: &B::Device) -> Self
fn fork(self, device: &B::Device) -> Self
§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: Backend> ModuleDisplay for Gaussian3dScene<B>
impl<B: Backend> ModuleDisplay for Gaussian3dScene<B>
§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