Skip to main content

Crate oxigaf_flame

Crate oxigaf_flame 

Source
Expand description

§oxigaf-flame

FLAME parametric head model implementation in Pure Rust.

This crate implements the FLAME (Faces Learned with an Articulated Model and Expressions) parametric 3D head model in pure Rust, with no dependencies on Python or C/C++ libraries.

§Features

  • FLAME model loading from .npy files (converted from the original .pkl)
  • Linear Blend Skinning (LBS) forward pass: parameters → posed mesh
  • CPU normal map rendering for diffusion model conditioning
  • Mesh surface point sampling for Gaussian initialization
  • Zero-cost abstractions with extensive use of #[inline] for performance

§Cargo Features

This crate supports the following feature flags:

  • simd (optional, requires nightly Rust with portable_simd): Enables SIMD-accelerated vector operations for:

    • Normal map rendering (3-4× faster)
    • Rodrigues rotation computation
    • Blend shape evaluation
  • parallel (optional): Enables parallel batch processing with rayon:

    • forward_batch_par() - parallel mesh generation
    • compute_normals_batch_par() - parallel normal computation
    • Near-linear speedup with CPU core count
  • full (convenience): Enables parallel and npz (both stable-Rust features). simd is intentionally excluded, since it requires nightly Rust – see full_nightly below.

  • full_nightly: Enables simd, parallel, and npz. Requires nightly Rust.

Example usage:

# In Cargo.toml
oxigaf-flame = { version = "0.1", features = ["parallel"] }

§Quick Start

use oxigaf_flame::{FlameModel, FlameParams};

// Load FLAME model from directory containing .npy files
let model = FlameModel::load("path/to/flame/model")?;

// Create neutral parameters (zero shape, expression, pose)
let params = FlameParams::neutral();

// Run forward pass to get posed mesh
let mesh = model.forward(&params);

println!("Generated mesh with {} vertices", mesh.vertices.len());

§FLAME Parameters

The FLAME model is controlled by several parameter types:

  • Shape parameters (β): Control identity-specific features (typically 100-300 coefficients)
  • Expression parameters (ψ): Control facial expressions (typically 50-100 coefficients)
  • Pose parameters (θ): Control joint rotations (5 joints × 3 = 15 values)
    • Root rotation (global head orientation)
    • Neck rotation
    • Jaw rotation
    • Left eye rotation
    • Right eye rotation
  • Translation: Global 3D translation applied after posing

§Coordinate System

FLAME uses a right-handed coordinate system:

  • +X: Left (from the subject’s perspective; the viewer’s right)
  • +Y: Up
  • +Z: Forward (out of the face, toward the viewer)

This matches vertex_mask::FaceRegion and head_geometry’s region classification, both of which place the subject’s left eye/cheek/ear at positive X.

Rotations are specified as axis-angle vectors and converted to rotation matrices using Rodrigues’ formula.

§Performance

The LBS forward pass is optimized for real-time performance:

  • ~1-2ms for standard FLAME mesh (5023 vertices) on modern CPUs
  • Critical path functions are marked with #[inline]
  • Uses ndarray for efficient array operations (pure Rust, no BLAS backend; see the COOLJAPAN Pure Rust policy)

Run benchmarks with: cargo bench -p oxigaf-flame

§References

Re-exports§

pub use albedo_map::albedo_brightness;
pub use albedo_map::albedo_to_vertex_colors;
pub use albedo_map::apply_ambient_occlusion;
pub use albedo_map::bake_vertex_albedo;
pub use albedo_map::blend_albedos;
pub use albedo_map::checker_texture;
pub use albedo_map::compute_albedo_stats;
pub use albedo_map::normalize_albedo;
pub use albedo_map::per_vertex_albedo_from_texture;
pub use albedo_map::sh_to_rgb;
pub use albedo_map::AlbedoColor;
pub use albedo_map::AlbedoConfig;
pub use albedo_map::AlbedoMapError;
pub use albedo_map::AlbedoStats;
pub use albedo_map::AlbedoTexture;
pub use avatar_rig::apply_rig_to_params;
pub use avatar_rig::compute_rig_stats;
pub use avatar_rig::generate_talking_animation;
pub use avatar_rig::interpolate_rigs;
pub use avatar_rig::standard_face_rig;
pub use avatar_rig::AvatarRig;
pub use avatar_rig::BlendTarget;
pub use avatar_rig::FlameRigParams;
pub use avatar_rig::RigAnimation;
pub use avatar_rig::RigControl;
pub use avatar_rig::RigError;
pub use avatar_rig::RigKeyframe;
pub use avatar_rig::RigStats;
pub use blend_shape_solver::apply_blend_displacements;
pub use blend_shape_solver::blend_solver_residual_curve;
pub use blend_shape_solver::compute_residual;
pub use blend_shape_solver::compute_solver_stats;
pub use blend_shape_solver::compute_vertex_errors;
pub use blend_shape_solver::fit_expression_coefficients;
pub use blend_shape_solver::format_solver_result;
pub use blend_shape_solver::gradient_wrt_weights;
pub use blend_shape_solver::nonneg_solve_blend_shapes;
pub use blend_shape_solver::project_weights;
pub use blend_shape_solver::solve_blend_shapes;
pub use blend_shape_solver::BlendBasis;
pub use blend_shape_solver::BlendSolverConfig;
pub use blend_shape_solver::BlendSolverError;
pub use blend_shape_solver::BlendSolverResult;
pub use blend_shape_solver::SolverStats;
pub use blend_shape_solver::WeightConstraints;
pub use canonical::compute_canonical_transform;
pub use canonical::compute_face_scale_for_image;
pub use canonical::estimate_head_orientation;
pub use canonical::face_bbox_2d;
pub use canonical::orthographic_project;
pub use canonical::CanonicalError;
pub use canonical::CanonicalFace;
pub use canonical::FaceBoundingBox;
pub use canonical::FaceKeypoints;
pub use canonical::HeadOrientation;
pub use contact_detection::analyze_contact;
pub use contact_detection::check_eye_contact;
pub use contact_detection::check_mouth_contact;
pub use contact_detection::classify_eye_state;
pub use contact_detection::classify_jaw_state;
pub use contact_detection::detect_mouth_transitions;
pub use contact_detection::detect_self_contact;
pub use contact_detection::find_contact_pairs;
pub use contact_detection::mean_distance_between_regions;
pub use contact_detection::mean_position;
pub use contact_detection::min_distance_between_regions;
pub use contact_detection::smooth_mouth_openings;
pub use contact_detection::ClippingStatus;
pub use contact_detection::ContactConfig;
pub use contact_detection::ContactError;
pub use contact_detection::ContactFlags;
pub use contact_detection::ContactPair;
pub use contact_detection::ContactReport;
pub use contact_detection::EyeContactState;
pub use contact_detection::EyeState;
pub use contact_detection::FlameContactRegions;
pub use contact_detection::JawState;
pub use contact_detection::MouthContactState;
pub use conversion::convert_npy_to_safetensors;
pub use conversion::convert_npy_to_safetensors_with_metadata;
pub use depth_estimation::blend_depth_maps;
pub use depth_estimation::compute_depth_stats;
pub use depth_estimation::depth_discontinuity_map;
pub use depth_estimation::depth_to_point_cloud;
pub use depth_estimation::front_depth_camera;
pub use depth_estimation::project_point;
pub use depth_estimation::render_conditioning_depth_maps;
pub use depth_estimation::render_depth_map;
pub use depth_estimation::side_depth_camera;
pub use depth_estimation::three_quarter_depth_camera;
pub use depth_estimation::DepthConfig;
pub use depth_estimation::DepthError;
pub use depth_estimation::DepthMap;
pub use depth_estimation::DepthStats;
pub use dynamic_landmarks::ContourSide;
pub use dynamic_landmarks::ContourVertexChains;
pub use dynamic_landmarks::DynamicLandmarkConfig;
pub use dynamic_landmarks::DynamicLandmarkExtractor;
pub use emotion_recognition::blend_emotion_params;
pub use emotion_recognition::compute_arousal_valence;
pub use emotion_recognition::compute_emotion_scores;
pub use emotion_recognition::compute_emotion_transition_rate;
pub use emotion_recognition::compute_expression_intensity;
pub use emotion_recognition::dominant_in_window;
pub use emotion_recognition::emotion_trajectory;
pub use emotion_recognition::format_emotion_result;
pub use emotion_recognition::recognize_emotion;
pub use emotion_recognition::smooth_emotion_trajectory;
pub use emotion_recognition::ArousalValence;
pub use emotion_recognition::BasicEmotion;
pub use emotion_recognition::EmotionConfig;
pub use emotion_recognition::EmotionError;
pub use emotion_recognition::EmotionResult;
pub use emotion_recognition::EmotionScore;
pub use emotion_recognition::EmotionTrajectory;
pub use error::FlameError;
pub use expression_animation::AnimationClip;
pub use expression_animation::AnimationError;
pub use expression_animation::AnimationPlayer;
pub use expression_animation::EasingFunction;
pub use expression_animation::ExpressionKeyframe;
pub use expression_animation::ExpressionTimeline;
pub use expression_animation::LoopMode;
pub use expression_clustering::assign_to_cluster;
pub use expression_clustering::cluster_path;
pub use expression_clustering::cluster_prototypes;
pub use expression_clustering::compute_cluster_stats;
pub use expression_clustering::davies_bouldin_index;
pub use expression_clustering::describe_clusters;
pub use expression_clustering::elbow_analysis;
pub use expression_clustering::expression_cosine_similarity;
pub use expression_clustering::expression_distance;
pub use expression_clustering::kmeans;
pub use expression_clustering::kmeans_iteration;
pub use expression_clustering::kmeans_plus_plus_init;
pub use expression_clustering::pairwise_distance_matrix_expr;
pub use expression_clustering::ClusterStats;
pub use expression_clustering::ClusteringResult;
pub use expression_clustering::ExpressionCluster;
pub use expression_clustering::ExpressionClusterError;
pub use expression_clustering::ExpressionDataset;
pub use expression_clustering::KMeansConfig;
pub use expression_retargeting::retar_blend_states;
pub use expression_retargeting::retar_build_expression_mirror_matrix;
pub use expression_retargeting::retar_compute_stats;
pub use expression_retargeting::retar_compute_variance;
pub use expression_retargeting::retar_expression_acceleration;
pub use expression_retargeting::retar_expression_similarity;
pub use expression_retargeting::retar_expression_velocity;
pub use expression_retargeting::retar_find_neutral_frame;
pub use expression_retargeting::retar_format_config;
pub use expression_retargeting::retar_format_stats;
pub use expression_retargeting::retar_mirror_expression;
pub use expression_retargeting::retar_resample_sequence;
pub use expression_retargeting::retar_slerp_states;
pub use expression_retargeting::retar_smooth_sequence;
pub use expression_retargeting::retar_standardize;
pub use expression_retargeting::retar_unstandardize;
pub use expression_retargeting::ExpressionState;
pub use expression_retargeting::ExpressionVarianceStats;
pub use expression_retargeting::LinearExpressionRetargeter;
pub use expression_retargeting::RetargetConfig;
pub use expression_retargeting::RetargetError;
pub use expression_retargeting::RetargetPair;
pub use expression_retargeting::RetargetStats;
pub use expression_transfer::blend_transferred;
pub use expression_transfer::classify_intensity;
pub use expression_transfer::direct_transfer;
pub use expression_transfer::expression_intensity;
pub use expression_transfer::expression_similarity;
pub use expression_transfer::find_nearest;
pub use expression_transfer::scaled_transfer;
pub use expression_transfer::style_transfer;
pub use expression_transfer::ExpressionPcaBasis;
pub use expression_transfer::ExpressionSpace;
pub use expression_transfer::ExpressionTransferError;
pub use expressions::ConstraintViolation;
pub use expressions::ExpressionBlend;
pub use expressions::ExpressionExt;
pub use expressions::ExpressionLibrary;
pub use expressions::ExpressionProvenance;
pub use expressions::FlameParamConstraints;
pub use expressions::NamedExpression;
pub use face_atlas::blit_into_atlas;
pub use face_atlas::compute_atlas_stats;
pub use face_atlas::create_flame_face_atlas;
pub use face_atlas::extract_from_atlas;
pub use face_atlas::next_power_of_two;
pub use face_atlas::pack_regions;
pub use face_atlas::rasterize_atlas_layout;
pub use face_atlas::AtlasConfig;
pub use face_atlas::AtlasRect;
pub use face_atlas::AtlasRegion;
pub use face_atlas::AtlasStats;
pub use face_atlas::FaceAtlas;
pub use face_atlas::FaceAtlasError;
pub use face_normalization::align_eye_line;
pub use face_normalization::align_frontal;
pub use face_normalization::apply_norm_transform;
pub use face_normalization::axis_angle_rotation;
pub use face_normalization::face_diagonal;
pub use face_normalization::format_norm_result;
pub use face_normalization::inter_pupil_distance;
pub use face_normalization::normalize_mesh;
pub use face_normalization::pca_axes;
pub use face_normalization::rotation_align;
pub use face_normalization::vertex_centroid;
pub use face_normalization::AlignMode;
pub use face_normalization::CenterMode;
pub use face_normalization::FaceNormError;
pub use face_normalization::NormConfig;
pub use face_normalization::NormResult;
pub use face_normalization::NormTransform;
pub use facs::ActionUnit;
pub use facs::AuMapping;
pub use facs::FacsIntensity;
pub use facs::FacsLibrary;
pub use facs::FacsPresets;
pub use facs::FacsToFlame;
pub use fitting::fit_landmarks;
pub use fitting::FittingConfig;
pub use fitting::FittingError;
pub use fitting::FittingParams;
pub use fitting::FittingResult;
pub use fitting::FlameForward;
pub use fitting::FlameLandmarkFitter;
pub use fitting::LandmarkObservation;
pub use fitting::MockFlameForward;
pub use fitting::PinholeCamera;
pub use geodesic::compute_geodesic_stats;
pub use geodesic::dijkstra;
pub use geodesic::geodesic_ball;
pub use geodesic::geodesic_center;
pub use geodesic::geodesic_center_sampled;
pub use geodesic::geodesic_diameter;
pub use geodesic::geodesic_voronoi;
pub use geodesic::geodesic_weights;
pub use geodesic::heat_geodesic;
pub use geodesic::heat_geodesic_multi;
pub use geodesic::heat_time_step;
pub use geodesic::multi_source_dijkstra;
pub use geodesic::pairwise_geodesic;
pub use geodesic::smooth_geodesic_path;
pub use geodesic::GeodesicConfig;
pub use geodesic::GeodesicError;
pub use geodesic::GeodesicField;
pub use geodesic::GeodesicMesh;
pub use geodesic::GeodesicStats;
pub use geodesic::DEFAULT_CENTER_SAMPLES;
pub use gpu_buffers::GpuBufferConfig;
pub use gpu_buffers::GpuMeshBuffers;
pub use head_geometry::classify_vertex_region;
pub use head_geometry::compute_head_geometry_stats;
pub use head_geometry::convex_hull_2d;
pub use head_geometry::find_nearest_vertex;
pub use head_geometry::format_head_geometry_stats;
pub use head_geometry::format_head_measurements;
pub use head_geometry::frontal_face_area;
pub use head_geometry::frontal_silhouette;
pub use head_geometry::head_bounding_box;
pub use head_geometry::head_centroid;
pub use head_geometry::head_dist3;
pub use head_geometry::head_profile_xz;
pub use head_geometry::head_surface_area;
pub use head_geometry::head_volume;
pub use head_geometry::height_histogram;
pub use head_geometry::label_vertices_by_region;
pub use head_geometry::max_pairwise_distance;
pub use head_geometry::measure_head;
pub use head_geometry::principal_axis;
pub use head_geometry::project_to_plane;
pub use head_geometry::region_centroid;
pub use head_geometry::vertex_asymmetry_scores;
pub use head_geometry::vertices_in_region;
pub use head_geometry::HeadGeometryError;
pub use head_geometry::HeadGeometryStats;
pub use head_geometry::HeadMeasurements;
pub use head_geometry::HeadRegion;
pub use head_tracker::compute_trajectory_stats;
pub use head_tracker::detect_pose_jumps;
pub use head_tracker::ema_smooth_trajectory;
pub use head_tracker::head_coverage_score;
pub use head_tracker::interpolate_missing_frames;
pub use head_tracker::one_euro_filter_sequence;
pub use head_tracker::resample_trajectory;
pub use head_tracker::rotation_velocity;
pub use head_tracker::segment_by_motion;
pub use head_tracker::slice_trajectory;
pub use head_tracker::sma_smooth_trajectory;
pub use head_tracker::HeadTrackFrame;
pub use head_tracker::HeadTrackPose;
pub use head_tracker::HeadTracker;
pub use head_tracker::HeadTrackerConfig;
pub use head_tracker::HeadTrackerError;
pub use head_tracker::HeadTrajectory;
pub use head_tracker::TrackingFilter;
pub use head_tracker::TrajectoryStats;
pub use io::load_flame_model;
pub use io_safetensors::load_flame_model_safetensors;
pub use io_safetensors::save_flame_model_safetensors;
pub use landmarks::BarycentricLandmark;
pub use landmarks::Landmark;
pub use landmarks::LandmarkExtractor;
pub use landmarks::LandmarkGroup;
pub use landmarks::NUM_LANDMARKS;
pub use lighting_model::apply_rim_lighting;
pub use lighting_model::approximate_ambient_occlusion;
pub use lighting_model::lambertian_diffuse;
pub use lighting_model::phong_vertex;
pub use lighting_model::phong_vertex_point;
pub use lighting_model::reinhard_tone_map;
pub use lighting_model::shade_mesh_directional;
pub use lighting_model::shade_mesh_multi_light;
pub use lighting_model::shade_mesh_sh_lighting;
pub use lighting_model::studio_lighting;
pub use lighting_model::AmbientLight;
pub use lighting_model::DirectionalLight;
pub use lighting_model::LightingError;
pub use lighting_model::LightingResult;
pub use lighting_model::PhongMaterial;
pub use lighting_model::PointLight;
pub use mesh::Mesh;
pub use mesh::MeshExportConfig;
pub use mesh_analysis::compute_face_areas;
pub use mesh_analysis::compute_face_aspect_ratios;
pub use mesh_analysis::compute_mesh_quality;
pub use mesh_analysis::find_boundary_edges;
pub use mesh_analysis::is_manifold_mesh;
pub use mesh_analysis::FaceQualityStats;
pub use mesh_analysis::MeshQualityReport;
pub use mesh_analysis::VertexQualityStats;
pub use mesh_morphing::apply_morph_targets;
pub use mesh_morphing::compute_delta_sequence;
pub use mesh_morphing::compute_morph_delta;
pub use mesh_morphing::delta_magnitudes;
pub use mesh_morphing::format_morph_clip;
pub use mesh_morphing::max_delta_magnitude;
pub use mesh_morphing::mean_delta_magnitude;
pub use mesh_morphing::morph_blend_n;
pub use mesh_morphing::morph_cosine;
pub use mesh_morphing::morph_cubic_hermite;
pub use mesh_morphing::morph_interpolate;
pub use mesh_morphing::morph_lerp;
pub use mesh_morphing::resample_morph_sequence;
pub use mesh_morphing::smooth_morph_sequence;
pub use mesh_morphing::MorphClip;
pub use mesh_morphing::MorphError;
pub use mesh_morphing::MorphInterpolation;
pub use mesh_morphing::MorphKeyframe;
pub use mesh_morphing::MorphLoopMode;
pub use mesh_morphing::MorphTarget;
pub use mesh_morphing::MorphTargetSet;
pub use mesh_ops::compute_laplacian_cotangent;
pub use mesh_ops::compute_laplacian_uniform;
pub use mesh_ops::cotangent_smooth;
pub use mesh_ops::find_boundary_vertices;
pub use mesh_ops::laplacian_smooth_step;
pub use mesh_ops::loop_subdivide;
pub use mesh_ops::midpoint_subdivide;
pub use mesh_ops::MeshOpsError;
pub use mesh_ops::MeshSmoothingConfig;
pub use mesh_ops::WeightMode;
pub use mesh_repair::repair_mesh;
pub use mesh_repair::MeshRepairConfig;
pub use mesh_repair::MeshRepairError;
pub use mesh_repair::MeshRepairExt;
pub use mesh_repair::MeshRepairResult;
pub use mesh_repair::MeshRepairStats;
pub use mesh_smoothing::build_adjacency;
pub use mesh_smoothing::build_cotan_adjacency;
pub use mesh_smoothing::compute_mesh_volume;
pub use mesh_smoothing::compute_smoothing_stats;
pub use mesh_smoothing::cotan_laplacian_smooth;
pub use mesh_smoothing::hc_laplacian_smooth;
pub use mesh_smoothing::laplacian_smooth;
pub use mesh_smoothing::restore_volume;
pub use mesh_smoothing::taubin_smooth;
pub use mesh_smoothing::HcLaplacianConfig;
pub use mesh_smoothing::LaplacianConfig;
pub use mesh_smoothing::SmoothingError;
pub use mesh_smoothing::SmoothingStats;
pub use mesh_smoothing::TaubinConfig;
pub use mesh_subdivision::compute_mean_edge_length;
pub use mesh_subdivision::compute_subdivision_stats;
pub use mesh_subdivision::estimate_subdivided_vertex_count;
pub use mesh_subdivision::format_subdivision_result;
pub use mesh_subdivision::recompute_mesh_normals;
pub use mesh_subdivision::subdivide_mesh;
pub use mesh_subdivision::subdivide_once;
pub use mesh_subdivision::validate_mesh_for_subdivision;
pub use mesh_subdivision::SubdivisionConfig;
pub use mesh_subdivision::SubdivisionError;
pub use mesh_subdivision::SubdivisionResult;
pub use mesh_subdivision::SubdivisionStats;
pub use model::compute_normals_batch;
pub use model::compute_normals_into;
pub use model::recompute_batch_normals;
pub use model::rodrigues;
pub use model::BatchBufferPool;
pub use model::BatchedFlameOutput;
pub use model::FlameModel;
pub use model::compute_normals_batch_par;
pub use model::recompute_batch_normals_par;
pub use multiresolution::compute_vertex_normals;
pub use multiresolution::DecimationConfig;
pub use multiresolution::MeshDecimator;
pub use multiresolution::MeshLevel;
pub use multiresolution::MultiResMesh;
pub use multiresolution::MultiResMeshBuilder;
pub use normal_map::Camera;
pub use normal_map::NormalMapRenderer;
pub use param_sampler::compute_sample_stats;
pub use param_sampler::flatten_params;
pub use param_sampler::van_der_corput;
pub use param_sampler::FlameParamsSampler;
pub use param_sampler::FlameParamsSpace;
pub use param_sampler::ParameterDimension;
pub use param_sampler::ParameterRange;
pub use param_sampler::SampleSetStats;
pub use param_sampler::SamplingStrategy;
pub use params::FlameParams;
pub use phoneme_animation::apply_coarticulation;
pub use phoneme_animation::blend_phoneme_with_base;
pub use phoneme_animation::extract_expression_sequence;
pub use phoneme_animation::extract_jaw_sequence;
pub use phoneme_animation::format_phoneme_clip;
pub use phoneme_animation::format_phoneme_stats;
pub use phoneme_animation::generate_breath_animation;
pub use phoneme_animation::parse_phoneme_string;
pub use phoneme_animation::phoneme_clip_stats;
pub use phoneme_animation::smooth_phoneme_keyframes;
pub use phoneme_animation::synthesize_phoneme_animation;
pub use phoneme_animation::PhonemeClip;
pub use phoneme_animation::PhonemeError;
pub use phoneme_animation::PhonemeEvent;
pub use phoneme_animation::PhonemeKeyframe;
pub use phoneme_animation::PhonemeLibrary;
pub use phoneme_animation::PhonemeParams;
pub use phoneme_animation::PhonemeStats;
pub use phoneme_animation::Viseme;
pub use phoneme_animation::VisemeExpressionTargets;
pub use pose_estimation::count_inliers;
pub use pose_estimation::estimate_pitch_from_vertical;
pub use pose_estimation::estimate_pose_weak_perspective;
pub use pose_estimation::estimate_yaw_from_symmetry;
pub use pose_estimation::reprojection_error;
pub use pose_estimation::select_pitch_candidate;
pub use pose_estimation::HeadPose;
pub use pose_estimation::Landmark2D;
pub use pose_estimation::Landmark3D;
pub use pose_estimation::PitchReference;
pub use pose_estimation::PointCorrespondence;
pub use pose_estimation::PoseConfig;
pub use pose_estimation::PoseEstimationError;
pub use pose_estimation::PosePinholeCamera;
pub use pose_estimation::PoseTracker;
pub use pose_prior::aa_magnitude;
pub use pose_prior::aa_to_euler_approx;
pub use pose_prior::default_joint_limits;
pub use pose_prior::get_joint;
pub use pose_prior::set_joint;
pub use pose_prior::GaussianPosePrior;
pub use pose_prior::JointLimits;
pub use pose_prior::PosePriorError;
pub use pose_prior::PoseScorer;
pub use pose_prior::PoseValidityReport;
pub use retargeting::apply_neutral_correction;
pub use retargeting::compute_expr_basis_scales;
pub use retargeting::compute_expression_scale_factors;
pub use retargeting::compute_neutral_correction;
pub use retargeting::compute_retargeting_stats;
pub use retargeting::decompose_expression;
pub use retargeting::recompose_expression;
pub use retargeting::retarget_expression;
pub use retargeting::retarget_sequence;
pub use retargeting::smooth_expression_sequence;
pub use retargeting::ExpressionRetargeter;
pub use retargeting::RetargetingConfig;
pub use retargeting::RetargetingError;
pub use retargeting::RetargetingStats;
pub use rigid_alignment::align_by_landmarks;
pub use rigid_alignment::align_by_weighted_landmarks;
pub use rigid_alignment::align_compute_stats;
pub use rigid_alignment::align_format_icp_result;
pub use rigid_alignment::align_format_stats;
pub use rigid_alignment::align_icp;
pub use rigid_alignment::align_nearest_neighbors;
pub use rigid_alignment::align_nearest_neighbors_filtered;
pub use rigid_alignment::align_procrustes;
pub use rigid_alignment::align_procrustes_rigid;
pub use rigid_alignment::align_rmse;
pub use rigid_alignment::AlignmentError;
pub use rigid_alignment::AlignmentStats;
pub use rigid_alignment::IcpConfig;
pub use rigid_alignment::IcpResult;
pub use rigid_alignment::SimilarityTransform;
pub use sampler::sample_mesh_surface;
pub use sampler::SurfacePoint;
pub use sequence::FlameSequence;
pub use sequence::SequenceIterator;
pub use shape_analysis::compute_shape_distance;
pub use shape_analysis::path_arc_length;
pub use shape_analysis::shape_interpolation_path;
pub use shape_analysis::ShapeAnalysisError;
pub use shape_analysis::ShapeDistanceMetric;
pub use shape_analysis::ShapeOutlierDetector;
pub use shape_analysis::ShapeSpacePca;
pub use shape_analysis::ShapeStatistics;
pub use statistical_shape_model::ssm_build;
pub use statistical_shape_model::ssm_component_sweep;
pub use statistical_shape_model::ssm_components_for_variance;
pub use statistical_shape_model::ssm_compute_stats;
pub use statistical_shape_model::ssm_fit;
pub use statistical_shape_model::ssm_format_model;
pub use statistical_shape_model::ssm_format_stats;
pub use statistical_shape_model::ssm_interpolate;
pub use statistical_shape_model::ssm_most_variable_vertices;
pub use statistical_shape_model::ssm_project;
pub use statistical_shape_model::ssm_random_shape;
pub use statistical_shape_model::ssm_reconstruct;
pub use statistical_shape_model::ssm_reconstruction_error;
pub use statistical_shape_model::ssm_vertex_std;
pub use statistical_shape_model::ShapeParameters;
pub use statistical_shape_model::SsmError;
pub use statistical_shape_model::SsmStats;
pub use statistical_shape_model::StatisticalShapeModel;
pub use symmetry::analyze_symmetry;
pub use symmetry::asymmetry_contribution;
pub use symmetry::asymmetry_heatmap;
pub use symmetry::blend_to_symmetric_params;
pub use symmetry::blend_with_symmetric;
pub use symmetry::generate_synthetic_symmetry_map;
pub use symmetry::per_vertex_asymmetry;
pub use symmetry::reflect_vertex;
pub use symmetry::symmetrize_mesh;
pub use symmetry::symmetrize_shape_params;
pub use symmetry::top_asymmetric_pairs;
pub use symmetry::validate_symmetry_map;
pub use symmetry::SymmetryError;
pub use symmetry::SymmetryMap;
pub use symmetry::SymmetryReport;
pub use texture_baking::apply_uv_padding;
pub use texture_baking::bake;
pub use texture_baking::bake_attribute;
pub use texture_baking::bake_normals;
pub use texture_baking::bake_positions;
pub use texture_baking::bake_vertex_colors;
pub use texture_baking::baked_texture_to_rgb;
pub use texture_baking::compute_face_uv_areas;
pub use texture_baking::compute_uv_mask;
pub use texture_baking::format_bake_stats;
pub use texture_baking::BakeAttribute;
pub use texture_baking::BakeConfig;
pub use texture_baking::BakeError;
pub use texture_baking::BakedTexture;
pub use texture_baking::TriangleUv;
pub use texture_baking::UvCoord as BakeUvCoord;
pub use timeline::timeline_from_clip;
pub use timeline::AnimationTimeline;
pub use timeline::BlendMode;
pub use timeline::TimelineError;
pub use timeline::TimelineLayer;
pub use timeline::TimelineMarker;
pub use traits::DefaultSampler;
pub use traits::FlameNormalMapProvider;
pub use traits::MeshSurfaceSampler;
pub use traits::NormalMapProvider;
pub use traits::SurfaceSample;
pub use uv::UvAccessor;
pub use uv::UvChartInfo;
pub use uv::UvMeshExt;
pub use uv_texture::FilterMode;
pub use uv_texture::TextureMap;
pub use uv_texture::TextureMeshExt;
pub use uv_texture::UvTextureSampler;
pub use uv_texture::WrapMode;
pub use vertex_mask::FaceRegion;
pub use vertex_mask::VertexMask;
pub use vertex_mask::VertexMaskError;
pub use visibility_culling::compute_face_visibility;
pub use visibility_culling::compute_greedy_view_selection;
pub use visibility_culling::compute_multi_view_visibility;
pub use visibility_culling::compute_optimal_view_coverage;
pub use visibility_culling::compute_per_view_coverage;
pub use visibility_culling::compute_per_view_visibility;
pub use visibility_culling::compute_vertex_visibility;
pub use visibility_culling::compute_visibility_stats;
pub use visibility_culling::find_view_dependent_vertices;
pub use visibility_culling::format_multi_view_stats;
pub use visibility_culling::format_visibility_stats;
pub use visibility_culling::select_greedy_covering_views;
pub use visibility_culling::select_maximally_covering_views;
pub use visibility_culling::select_top_coverage_views;
pub use visibility_culling::FaceVisibility;
pub use visibility_culling::MultiViewVisibility;
pub use visibility_culling::VertexVisibility;
pub use visibility_culling::VisibilityCullerConfig;
pub use visibility_culling::VisibilityError;
pub use visibility_culling::VisibilityStats;
pub use visualize::render_joints_svg;
pub use visualize::render_mesh_with_joints;
pub use visualize::render_wireframe;
pub use visualize::save_svg;
pub use visualize::SvgCamera;
pub use visualize::WireframeOptions;
pub use warp_field::build_vertex_adjacency;
pub use warp_field::compute_warp_stats;
pub use warp_field::find_large_displacements;
pub use warp_field::laplacian_smooth_warp_field;
pub use warp_field::linear_combination;
pub use warp_field::per_vertex_magnitude;
pub use warp_field::WarpField;
pub use warp_field::WarpFieldError;
pub use warp_field::WarpFieldSequence;
pub use warp_field::WarpFieldStats;
pub use warp_field::WarpMask;
pub use gaze_controller::gz_angular_velocity;
pub use gaze_controller::gz_compute_stats;
pub use gaze_controller::gz_convergence_angle_deg;
pub use gaze_controller::gz_detect_fixations;
pub use gaze_controller::gz_detect_saccades;
pub use gaze_controller::gz_dispersion;
pub use gaze_controller::gz_format_stats;
pub use gaze_controller::gz_listing_axis;
pub use gaze_controller::gz_listing_rotation;
pub use gaze_controller::gz_vergence_from_iod;
pub use gaze_controller::BlinkEvent;
pub use gaze_controller::BlinkPhase;
pub use gaze_controller::FixationEvent;
pub use gaze_controller::GazeController;
pub use gaze_controller::GazeControllerConfig;
pub use gaze_controller::GazeControllerError;
pub use gaze_controller::GazeDirection;
pub use gaze_controller::GazeEventKind;
pub use gaze_controller::GazeFrame;
pub use gaze_controller::GazeStats;
pub use gaze_controller::SaccadeEvent;
pub use spectral_analysis::spec_build_combinatorial_laplacian;
pub use spectral_analysis::spec_build_cotangent_laplacian;
pub use spectral_analysis::spec_cluster_vertices;
pub use spectral_analysis::spec_compute_stats;
pub use spectral_analysis::spec_format_config;
pub use spectral_analysis::spec_format_stats;
pub use spectral_analysis::spec_gram_schmidt;
pub use spectral_analysis::spec_high_pass_filter;
pub use spectral_analysis::spec_laplacian_matvec;
pub use spectral_analysis::spec_laplacian_smooth;
pub use spectral_analysis::spec_low_pass_filter;
pub use spectral_analysis::spec_normalize_laplacian;
pub use spectral_analysis::spec_power_iteration;
pub use spectral_analysis::spec_project;
pub use spectral_analysis::spec_rayleigh_quotient;
pub use spectral_analysis::spec_reconstruct;
pub use spectral_analysis::spec_smoothness;
pub use spectral_analysis::spec_taubin_smooth;
pub use spectral_analysis::LaplacianKind;
pub use spectral_analysis::MeshLaplacian;
pub use spectral_analysis::SpectralBasis;
pub use spectral_analysis::SpectralConfig;
pub use spectral_analysis::SpectralError;
pub use spectral_analysis::SpectralSignal;
pub use spectral_analysis::SpectralStats;

Modules§

albedo_map
Albedo map utilities for FLAME head model.
avatar_rig
High-level avatar rig that maps intuitive control parameters to FLAME parameters.
blend_shape_solver
Blend shape solver: inverse FLAME optimization.
canonical
Canonical face pose and alignment utilities for FLAME meshes.
contact_detection
Self-contact detection for FLAME head meshes.
conversion
Conversion utilities for FLAME model formats.
depth_estimation
CPU depth map rendering from FLAME meshes.
dynamic_landmarks
Pose-dependent dynamic face contour landmark extraction.
emotion_recognition
Emotion Recognition from FLAME Expression Parameters
error
Error types for the FLAME module.
expression_animation
Expression animation system for the FLAME model.
expression_clustering
K-means clustering and analysis of facial expressions in FLAME expression parameter space.
expression_retargeting
Expression retargeting between FLAME identities (linear mapper).
expression_transfer
Expression transfer between FLAME parameter spaces.
expressions
Named facial expression presets and blending utilities for the FLAME model.
face_atlas
Face atlas packing for FLAME head model regions.
face_normalization
Face normalization: canonical pose and scale utilities for FLAME head meshes.
facs
Facial Action Coding System (FACS) mapping to FLAME expression parameters.
fitting
CPU-based gradient-descent fitting of FLAME model parameters to 2D landmark observations.
gaze_controller
Eye Gaze Estimation and Control
geodesic
Geodesic distance computation on triangle mesh surfaces.
gpu_buffers
GPU-ready mesh buffer export for wgpu integration.
head_geometry
Head geometry utilities: anthropometric measurements, anatomical region analysis, and geometric properties of FLAME head meshes.
head_tracker
Head tracking over video sequences.
io
Load FLAME model data from a directory of .npy files.
io_safetensors
Load and save FLAME models using the safetensors format.
landmarks
68-point facial landmark extraction for FLAME meshes.
lighting_model
Lighting models for FLAME head mesh rendering.
mesh
Triangle mesh with per-vertex normals.
mesh_analysis
Mesh quality analysis for FLAME meshes.
mesh_morphing
Mesh morphing — smooth blending between FLAME mesh poses/shapes.
mesh_ops
Mesh smoothing and subdivision operations.
mesh_repair
Mesh repair and cleanup utilities.
mesh_smoothing
Mesh smoothing algorithms for 3D triangle meshes.
mesh_subdivision
Loop subdivision of triangle meshes.
model
FLAME model: loading, blend shapes, LBS forward pass.
multiresolution
Multi-resolution mesh (Level-of-Detail) support via Quadric Error Metric decimation.
normal_map
CPU software rasterizer for FLAME normal maps.
param_sampler
FLAME parameter space sampler.
params
FLAME model parameters for a single frame / pose.
phoneme_animation
Phoneme-to-FLAME-parameter mapping and speech animation synthesis.
pose_estimation
Head pose estimation from 2D facial landmark observations.
pose_prior
Pose prior for the FLAME parametric head model.
retargeting
Expression retargeting between FLAME identities.
rigid_alignment
Rigid and Similarity Alignment
sampler
Area-weighted random point sampling on a triangle mesh surface.
sequence
Video sequences of FLAME parameters
shape_analysis
Statistical analysis tools for FLAME shape space exploration.
spectral_analysis
Graph Laplacian spectral analysis of the FLAME mesh.
statistical_shape_model
Statistical Shape Model (SSM) for FLAME head shapes.
symmetry
Bilateral symmetry analysis and enforcement for FLAME meshes.
texture_baking
Texture baking for FLAME meshes.
timeline
Higher-level multi-clip animation orchestration layer.
traits
Integration traits for FLAME components.
uv
UV coordinate support for FLAME meshes.
uv_texture
UV texture map loading and sampling for FLAME meshes.
vertex_mask
Vertex mask (face region segmentation) for FLAME meshes.
visibility_culling
Per-vertex and per-face visibility culling for FLAME meshes.
visualize
Pure-Rust SVG visualization utilities for FLAME mesh and skeleton.
warp_field
Dense per-vertex 3D displacement (warp) fields for non-rigid mesh deformation.

Structs§

FlameParamsBuilder
Builder for constructing FlameParams with a fluent API.