pub struct SmplXGPU<B: Backend> {Show 22 fields
pub device: B::Device,
pub smpl_type: SmplType,
pub gender: Gender,
pub verts_template: Tensor<B, 2, Float>,
pub faces: Tensor<B, 2, Int>,
pub faces_uv_mesh: Tensor<B, 2, Int>,
pub uv: Tensor<B, 2, Float>,
pub shape_dirs: Tensor<B, 2, Float>,
pub expression_dirs: Option<Tensor<B, 2, Float>>,
pub pose_dirs: Option<Tensor<B, 2, Float>>,
pub joint_regressor: Tensor<B, 2, Float>,
pub parent_idx_per_joint: Tensor<B, 1, Int>,
pub lbs_weights: Tensor<B, 2, Float>,
pub verts_ones: Tensor<B, 2, Float>,
pub idx_vuv_2_vnouv: Tensor<B, 1, Int>,
pub faces_na: DMatrix<u32>,
pub faces_uv_mesh_na: DMatrix<u32>,
pub uv_na: DMatrix<f32>,
pub idx_vuv_2_vnouv_vec: Vec<usize>,
pub lbs_weights_split: Tensor<B, 2>,
pub lbs_weights_nd: ArcArray2<f32>,
pub lbs_weights_split_nd: ArcArray2<f32>,
}Fields§
§device: B::Device§smpl_type: SmplType§gender: Gender§verts_template: Tensor<B, 2, Float>§faces: Tensor<B, 2, Int>§faces_uv_mesh: Tensor<B, 2, Int>§uv: Tensor<B, 2, Float>§shape_dirs: Tensor<B, 2, Float>§expression_dirs: Option<Tensor<B, 2, Float>>§pose_dirs: Option<Tensor<B, 2, Float>>§joint_regressor: Tensor<B, 2, Float>§parent_idx_per_joint: Tensor<B, 1, Int>§lbs_weights: Tensor<B, 2, Float>§verts_ones: Tensor<B, 2, Float>§idx_vuv_2_vnouv: Tensor<B, 1, Int>§faces_na: DMatrix<u32>§faces_uv_mesh_na: DMatrix<u32>§uv_na: DMatrix<f32>§idx_vuv_2_vnouv_vec: Vec<usize>§lbs_weights_split: Tensor<B, 2>§lbs_weights_nd: ArcArray2<f32>§lbs_weights_split_nd: ArcArray2<f32>Implementations§
Source§impl<B: Backend> SmplXGPU<B>
impl<B: Backend> SmplXGPU<B>
Sourcepub fn new_from_matrices(
gender: Gender,
verts_template: &Array2<f32>,
faces: &Array2<u32>,
faces_uv_mesh: &Array2<u32>,
uv: &Array2<f32>,
shape_dirs: &Array3<f32>,
expression_dirs: Option<Array3<f32>>,
pose_dirs: Option<Array3<f32>>,
joint_regressor: &Array2<f32>,
parent_idx_per_joint: &Array1<u32>,
lbs_weights: Array2<f32>,
max_num_betas: usize,
max_num_expression_components: usize,
) -> Self
pub fn new_from_matrices( gender: Gender, verts_template: &Array2<f32>, faces: &Array2<u32>, faces_uv_mesh: &Array2<u32>, uv: &Array2<f32>, shape_dirs: &Array3<f32>, expression_dirs: Option<Array3<f32>>, pose_dirs: Option<Array3<f32>>, joint_regressor: &Array2<f32>, parent_idx_per_joint: &Array1<u32>, lbs_weights: Array2<f32>, max_num_betas: usize, max_num_expression_components: usize, ) -> Self
§Panics
Will panic if the matrices don’t match the expected sizes
Sourcepub fn new_from_npz(
model_path: &str,
gender: Gender,
max_num_betas: usize,
max_num_expression_components: usize,
) -> Self
pub fn new_from_npz( model_path: &str, gender: Gender, max_num_betas: usize, max_num_expression_components: usize, ) -> Self
§Panics
Will panic if the path cannot be opened
Sourcepub async fn new_from_npz_async(
model_path: &str,
gender: Gender,
max_num_betas: usize,
max_num_expression_components: usize,
) -> Self
pub async fn new_from_npz_async( model_path: &str, gender: Gender, max_num_betas: usize, max_num_expression_components: usize, ) -> Self
§Panics
Will panic if the path cannot be opened Will panic if the translation and rotation do not cover the same number of timesteps
Trait Implementations§
Source§impl<B: Backend> FaceModel<B> for SmplXGPU<B>where
B::IntTensorPrimitive<1>: Sync,
B::IntTensorPrimitive<2>: Sync,
B::FloatTensorPrimitive<2>: Sync,
B::QuantizedTensorPrimitive<2>: Sync,
impl<B: Backend> FaceModel<B> for SmplXGPU<B>where
B::IntTensorPrimitive<1>: Sync,
B::IntTensorPrimitive<2>: Sync,
B::FloatTensorPrimitive<2>: Sync,
B::QuantizedTensorPrimitive<2>: Sync,
fn expression2offsets(&self, expression: &Expression) -> Tensor<B, 2, Float>
Source§impl<B: Backend> SmplModel<B> for SmplXGPU<B>where
B::FloatTensorPrimitive<2>: Sync,
B::IntTensorPrimitive<2>: Sync,
B::IntTensorPrimitive<1>: Sync,
B::QuantizedTensorPrimitive<1>: Sync,
B::QuantizedTensorPrimitive<2>: Sync,
impl<B: Backend> SmplModel<B> for SmplXGPU<B>where
B::FloatTensorPrimitive<2>: Sync,
B::IntTensorPrimitive<2>: Sync,
B::IntTensorPrimitive<1>: Sync,
B::QuantizedTensorPrimitive<1>: Sync,
B::QuantizedTensorPrimitive<2>: Sync,
fn clone_dyn(&self) -> Box<dyn SmplModel<B>>
fn as_any(&self) -> &dyn Any
fn smpl_type(&self) -> SmplType
fn gender(&self) -> Gender
fn get_face_model(&self) -> &dyn FaceModel<B>
fn forward( &self, options: &SmplOptions, betas: &Betas, pose_raw: &Pose, expression: Option<&Expression>, ) -> SmplOutputDynamic<B>
fn create_body_with_uv( &self, smpl_merged: &SmplOutputDynamic<B>, ) -> SmplOutputDynamic<B>
fn betas2verts(&self, betas: &Betas) -> Tensor<B, 2, Float>
fn verts2joints(&self, verts_t_pose: Tensor<B, 2, Float>) -> Tensor<B, 2, Float>
fn compute_pose_correctives(&self, pose: &Pose) -> Tensor<B, 2, Float>
fn compute_pose_feature(&self, pose: &Pose) -> Array1<f32>
fn apply_pose( &self, verts_t_pose: &Tensor<B, 2, Float>, normals: Option<&Tensor<B, 2, Float>>, tangents: Option<&Tensor<B, 2, Float>>, joints: &Tensor<B, 2, Float>, lbs_weights: &Tensor<B, 2, Float>, pose: &Pose, ) -> (Tensor<B, 2, Float>, Option<Tensor<B, 2, Float>>, Option<Tensor<B, 2, Float>>, Tensor<B, 2, Float>)
fn faces(&self) -> &Tensor<B, 2, Int>
fn faces_uv(&self) -> &Tensor<B, 2, Int>
fn uv(&self) -> &Tensor<B, 2, Float>
fn lbs_weights(&self) -> Tensor<B, 2, Float>
fn lbs_weights_split(&self) -> Tensor<B, 2, Float>
fn idx_split_2_merged(&self) -> Tensor<B, 1, Int>
fn idx_split_2_merged_vec(&self) -> &Vec<usize>
fn set_pose_dirs(&mut self, pose_dirs: Tensor<B, 2, Float>)
fn get_pose_dirs(&self) -> Tensor<B, 2, Float>
fn get_expression_dirs(&self) -> Option<Tensor<B, 2, Float>>
Auto Trait Implementations§
impl<B> Freeze for SmplXGPU<B>where
<B as Backend>::Device: Freeze,
<B as Backend>::IntTensorPrimitive<2>: Freeze,
<B as Backend>::IntTensorPrimitive<1>: Freeze,
<B as Backend>::FloatTensorPrimitive<2>: Freeze,
<B as Backend>::QuantizedTensorPrimitive<2>: Freeze,
impl<B> RefUnwindSafe for SmplXGPU<B>where
<B as Backend>::Device: RefUnwindSafe,
<B as Backend>::IntTensorPrimitive<2>: RefUnwindSafe,
<B as Backend>::IntTensorPrimitive<1>: RefUnwindSafe,
<B as Backend>::FloatTensorPrimitive<2>: RefUnwindSafe,
<B as Backend>::QuantizedTensorPrimitive<2>: RefUnwindSafe,
impl<B> Send for SmplXGPU<B>
impl<B> Sync for SmplXGPU<B>where
<B as Backend>::IntTensorPrimitive<2>: Sync,
<B as Backend>::IntTensorPrimitive<1>: Sync,
<B as Backend>::FloatTensorPrimitive<2>: Sync,
<B as Backend>::QuantizedTensorPrimitive<2>: Sync,
impl<B> Unpin for SmplXGPU<B>where
<B as Backend>::Device: Unpin,
<B as Backend>::IntTensorPrimitive<2>: Unpin,
<B as Backend>::IntTensorPrimitive<1>: Unpin,
<B as Backend>::FloatTensorPrimitive<2>: Unpin,
<B as Backend>::QuantizedTensorPrimitive<2>: Unpin,
impl<B> UnwindSafe for SmplXGPU<B>where
<B as Backend>::Device: UnwindSafe,
<B as Backend>::IntTensorPrimitive<2>: UnwindSafe,
<B as Backend>::IntTensorPrimitive<1>: UnwindSafe,
<B as Backend>::FloatTensorPrimitive<2>: UnwindSafe,
<B as Backend>::QuantizedTensorPrimitive<2>: UnwindSafe,
Blanket Implementations§
Source§impl<T> AlignerFor<1> for T
impl<T> AlignerFor<1> for T
Source§impl<T> AlignerFor<1024> for T
impl<T> AlignerFor<1024> for T
Source§type Aligner = AlignTo1024<T>
type Aligner = AlignTo1024<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<128> for T
impl<T> AlignerFor<128> for T
Source§type Aligner = AlignTo128<T>
type Aligner = AlignTo128<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<16> for T
impl<T> AlignerFor<16> for T
Source§impl<T> AlignerFor<16384> for T
impl<T> AlignerFor<16384> for T
Source§type Aligner = AlignTo16384<T>
type Aligner = AlignTo16384<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<2> for T
impl<T> AlignerFor<2> for T
Source§impl<T> AlignerFor<2048> for T
impl<T> AlignerFor<2048> for T
Source§type Aligner = AlignTo2048<T>
type Aligner = AlignTo2048<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<256> for T
impl<T> AlignerFor<256> for T
Source§type Aligner = AlignTo256<T>
type Aligner = AlignTo256<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<32> for T
impl<T> AlignerFor<32> for T
Source§impl<T> AlignerFor<32768> for T
impl<T> AlignerFor<32768> for T
Source§type Aligner = AlignTo32768<T>
type Aligner = AlignTo32768<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<4> for T
impl<T> AlignerFor<4> for T
Source§impl<T> AlignerFor<4096> for T
impl<T> AlignerFor<4096> for T
Source§type Aligner = AlignTo4096<T>
type Aligner = AlignTo4096<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<512> for T
impl<T> AlignerFor<512> for T
Source§type Aligner = AlignTo512<T>
type Aligner = AlignTo512<T>
The
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<64> for T
impl<T> AlignerFor<64> for T
Source§impl<T> AlignerFor<8> for T
impl<T> AlignerFor<8> for T
Source§impl<T> AlignerFor<8192> for T
impl<T> AlignerFor<8192> for T
Source§type Aligner = AlignTo8192<T>
type Aligner = AlignTo8192<T>
The
AlignTo* type which aligns Self to ALIGNMENT.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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
Source§fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
Converts a reference to an FFI-safe type
Source§fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
Converts an FFI-safe type to a reference
Source§impl<S> ROExtAcc for S
impl<S> ROExtAcc for S
Source§fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
Gets a reference to a field, determined by
offset. Read moreSource§fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
Gets a muatble reference to a field, determined by
offset. Read moreSource§fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
Gets a const pointer to a field,
the field is determined by
offset. Read moreSource§fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
Gets a mutable pointer to a field, determined by
offset. Read moreSource§impl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
Replaces a field (determined by
offset) with value,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
Source§impl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
Replaces a field (determined by
offset) with value,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
Source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Emulates the pipeline operator, allowing method syntax in more places. Read more
Source§fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
The same as
piped except that the function takes &Self
Useful for functions that take &Self instead of Self. Read moreSource§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
The same as
piped, except that the function takes &mut Self.
Useful for functions that take &mut Self instead of Self.Source§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
Mutates self using a closure taking self by mutable reference,
passing it along the method chain. Read more
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Observes the value of self, passing it along unmodified.
Useful in long method chains. Read more
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
Performs a reference to reference conversion with
AsRef,
using the turbofish .as_ref_::<_>() syntax. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<This> TransmuteElement for Thiswhere
This: ?Sized,
impl<This> TransmuteElement for Thiswhere
This: ?Sized,
Source§unsafe fn transmute_element<T>(self) -> Self::TransmutedPtrwhere
Self: CanTransmuteElement<T>,
unsafe fn transmute_element<T>(self) -> Self::TransmutedPtrwhere
Self: CanTransmuteElement<T>,
Transmutes the element type of this pointer.. Read more
Source§impl<T> TypeIdentity for Twhere
T: ?Sized,
impl<T> TypeIdentity for Twhere
T: ?Sized,
Source§fn as_type_mut(&mut self) -> &mut Self::Type
fn as_type_mut(&mut self) -> &mut Self::Type
Converts a mutable reference back to the original type.
Source§fn into_type_box(self: Box<Self>) -> Box<Self::Type>
fn into_type_box(self: Box<Self>) -> Box<Self::Type>
Converts a box back to the original type.
Source§fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>
fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>
Converts an Arc back to the original type. Read more
Source§fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>
fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>
Converts an Rc back to the original type. Read more
Source§fn from_type_ref(this: &Self::Type) -> &Self
fn from_type_ref(this: &Self::Type) -> &Self
Converts a reference back to the original type.
Source§fn from_type_mut(this: &mut Self::Type) -> &mut Self
fn from_type_mut(this: &mut Self::Type) -> &mut Self
Converts a mutable reference back to the original type.
Source§fn from_type_box(this: Box<Self::Type>) -> Box<Self>
fn from_type_box(this: Box<Self::Type>) -> Box<Self>
Converts a box back to the original type.