gausplat_trainer::train::gaussian_3d

Struct Gaussian3dScene

source
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].

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,

Scene exporters

source

pub fn encode_polygon(&self, writer: &mut impl Write) -> Result<(), Error>

Export the scene in the 3DGS PLY format.

source

pub fn to_points(&self) -> Vec<Point>

Export the scene as a point cloud.

source§

impl<B> Gaussian3dScene<B>
where B: Backend,

Scene importers

source

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.

source

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,

Outer property value getters

source

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].

It is represented as orthonormalized spherical harmonic with RGB channels.

source

pub fn get_opacities(&self) -> Tensor<B, 2>

Opacities. (Outer value)

The shape is [P, 1].

They range from 0.0 to 1.0.

source

pub fn get_positions(&self) -> Tensor<B, 2>

3D Positions. (Outer value)

The shape is [P, 3].

source

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].

source

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,

Outer property value makers

source

pub fn make_colors_sh(colors_sh: Tensor<B, 2>) -> Tensor<B, 2>

source

pub fn make_opacities(opacities: Tensor<B, 2>) -> Tensor<B, 2>

source

pub fn make_positions(positions: Tensor<B, 2>) -> Tensor<B, 2>

source

pub fn make_rotations(rotations: Tensor<B, 2>) -> Tensor<B, 2>

source

pub fn make_scalings(scalings: Tensor<B, 2>) -> Tensor<B, 2>

source§

impl<B> Gaussian3dScene<B>
where B: Backend,

Outer property value setters

source

pub fn set_colors_sh( &mut self, colors_sh: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>

Setting values for Gaussian3dScene::get_colors_sh

source

pub fn set_opacities( &mut self, opacities: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>

Setting values for Gaussian3dScene::get_opacities

source

pub fn set_positions( &mut self, positions: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>

Setting values for Gaussian3dScene::get_positions

source

pub fn set_rotations( &mut self, rotations: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>

Setting values for Gaussian3dScene::get_rotations

source

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,

Inner property value makers

source

pub fn make_inner_colors_sh(colors_sh: Tensor<B, 2>) -> Tensor<B, 2>

Making values for Gaussian3dScene::colors_sh

source

pub fn make_inner_opacities(opacities: Tensor<B, 2>) -> Tensor<B, 2>

Making values for Gaussian3dScene::opacities

source

pub fn make_inner_positions(positions: Tensor<B, 2>) -> Tensor<B, 2>

Making values for Gaussian3dScene::positions

source

pub fn make_inner_rotations(rotations: Tensor<B, 2>) -> Tensor<B, 2>

Making values for Gaussian3dScene::rotations

source

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,

Inner property value setters

source

pub fn set_inner_colors_sh( &mut self, colors_sh: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>

Setting inner values for Gaussian3dScene::colors_sh

source

pub fn set_inner_opacities( &mut self, opacities: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>

Setting inner values for Gaussian3dScene::opacities

source

pub fn set_inner_positions( &mut self, positions: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>

Setting inner values for Gaussian3dScene::positions

source

pub fn set_inner_rotations( &mut self, rotations: Tensor<B, 2>, ) -> &mut Gaussian3dScene<B>

Setting inner values for Gaussian3dScene::rotations

source

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,

Attribute getters

source

pub fn device(&self) -> <B as Backend>::Device

The device.

source

pub fn point_count(&self) -> usize

Number of points.

source

pub fn size(&self) -> usize

Size of the parameters in bytes.

source

pub fn size_readable(&self) -> String

Readable size of the parameters.

source§

impl<B> Gaussian3dScene<B>

source

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>>

source

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>

source§

type InnerModule = Gaussian3dScene<<B as AutodiffBackend>::InnerBackend>

Inner module without auto-differentiation.
source§

fn valid(&self) -> <Gaussian3dScene<B> as AutodiffModule<B>>::InnerModule

Get the same module, but on the inner backend without auto-differentiation.
source§

impl<B> Clone for Gaussian3dScene<B>
where B: Backend,

source§

fn clone(&self) -> Gaussian3dScene<B>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<B> Debug for Gaussian3dScene<B>
where B: Backend,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<B> Default for Gaussian3dScene<B>
where B: Backend,

source§

fn default() -> Gaussian3dScene<B>

Returns the “default value” for a type. Read more
source§

impl<B> Display for Gaussian3dScene<B>
where B: Backend,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

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>

Render the 3DGS scene (forward).
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>>

Render the 3DGS scene (backward). Read more
source§

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>

Render the 3DGS scene (forward).
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>>

Render the 3DGS scene (backward). Read more
source§

impl<B> Module<B> for Gaussian3dScene<B>
where B: Backend,

source§

type Record = Gaussian3dSceneRecord<B>

Type to save and load the module.
source§

fn load_record( self, record: <Gaussian3dScene<B> as Module<B>>::Record, ) -> Gaussian3dScene<B>

Load the module state from a record.
source§

fn into_record(self) -> <Gaussian3dScene<B> as Module<B>>::Record

Convert the module into a record containing the state.
source§

fn num_params(&self) -> usize

Get the number of parameters the module has, including all of its sub-modules.
source§

fn visit<Visitor>(&self, visitor: &mut Visitor)
where Visitor: ModuleVisitor<B>,

Visit each tensor parameter in the module with a visitor.
source§

fn map<Mapper>(self, mapper: &mut Mapper) -> Gaussian3dScene<B>
where Mapper: ModuleMapper<B>,

Map each tensor parameter in the module with a mapper.
source§

fn collect_devices( &self, devices: Vec<<B as Backend>::Device>, ) -> Vec<<B as Backend>::Device>

Return all the devices found in the underneath module tree added to the given vector without duplicates.
source§

fn to_device(self, device: &<B as Backend>::Device) -> Gaussian3dScene<B>

Move the module and all of its sub-modules to the given device. Read more
source§

fn fork(self, device: &<B as Backend>::Device) -> Gaussian3dScene<B>

Fork the module and all of its sub-modules to the given device. Read more
§

fn devices(&self) -> Vec<<B as Backend>::Device>

Return all the devices found in the underneath module tree without duplicates.
§

fn no_grad(self) -> Self

Each tensor in the module tree will not require grad. Read more
§

fn save_file<FR, PB>( self, file_path: PB, recorder: &FR, ) -> Result<(), RecorderError>
where FR: FileRecorder<B>, PB: Into<PathBuf>,

Save the module to a file using the provided file recorder. Read more
§

fn load_file<FR, PB>( self, file_path: PB, recorder: &FR, device: &<B as Backend>::Device, ) -> Result<Self, RecorderError>
where FR: FileRecorder<B>, PB: Into<PathBuf>,

Load the module from a file using the provided file recorder. Read more
§

fn quantize_weights<C>(self, quantizer: &mut Quantizer<C>) -> Self
where C: Calibration,

Quantize the weights of the module.
source§

impl<B> ModuleDisplay for Gaussian3dScene<B>
where B: Backend,

§

fn format(&self, passed_settings: DisplaySettings) -> String

Formats the module with provided display settings. Read more
§

fn custom_settings(&self) -> Option<DisplaySettings>

Custom display settings for the module. Read more
§

fn custom_content(&self, _content: Content) -> Option<Content>

Custom attributes for the module. Read more
source§

impl<B> ModuleDisplayDefault for Gaussian3dScene<B>
where B: Backend,

source§

fn content(&self, content: Content) -> Option<Content>

Attributes of the module used for display purposes. Read more
source§

fn num_params(&self) -> usize

Gets the number of the parameters of the module.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WasmNotSend for T
where T: Send,