#[non_exhaustive]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum ZensimProfile {
PreviewV0_1,
PreviewV0_2,
}
impl ZensimProfile {
pub fn latest() -> Self {
Self::PreviewV0_2
}
pub fn name(&self) -> &'static str {
match self {
Self::PreviewV0_1 => "zensim-preview-v0.1",
Self::PreviewV0_2 => "zensim-preview-v0.2",
}
}
pub(crate) fn params(&self) -> &'static ProfileParams {
match self {
Self::PreviewV0_1 => &PROFILE_PREVIEW_V0_1,
Self::PreviewV0_2 => &PROFILE_PREVIEW_V0_2,
}
}
}
impl core::fmt::Display for ZensimProfile {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str(self.name())
}
}
#[cfg_attr(not(feature = "training"), allow(dead_code))]
pub struct ProfileParams {
pub weights: &'static [f64],
pub blur_radius: usize,
pub blur_passes: u8,
pub num_scales: usize,
pub score_mapping_a: f64,
pub score_mapping_b: f64,
}
#[cfg(feature = "training")]
impl ProfileParams {
pub fn custom(
weights: &'static [f64],
blur_radius: usize,
blur_passes: u8,
num_scales: usize,
score_mapping_a: f64,
score_mapping_b: f64,
) -> Self {
Self {
weights,
blur_radius,
blur_passes,
num_scales,
score_mapping_a,
score_mapping_b,
}
}
}
static PROFILE_PREVIEW_V0_1: ProfileParams = ProfileParams {
weights: &WEIGHTS_PREVIEW_V0_1,
blur_radius: 5,
blur_passes: 1,
num_scales: 4,
score_mapping_a: 18.0,
score_mapping_b: 0.7,
};
static PROFILE_PREVIEW_V0_2: ProfileParams = ProfileParams {
weights: &WEIGHTS_PREVIEW_V0_2,
blur_radius: 5,
blur_passes: 1,
num_scales: 4,
score_mapping_a: 18.0,
score_mapping_b: 0.7,
};
#[allow(clippy::excessive_precision)]
pub static WEIGHTS_PREVIEW_V0_1: [f64; 228] = [
0.0000000000,
0.1391674808,
0.0000000000,
0.0055172171,
0.0000000000,
0.0000000000,
0.0000000000,
0.0010650645,
0.0071194723,
69.6110793540,
0.0106660235,
0.0076379521,
0.0051069220, 17.8445125125,
1.9157888513,
0.0109886875,
0.0048996910,
0.0000000000,
0.0018418193,
0.0000000000,
1.5940983560,
0.0072914879,
0.0000000000,
0.2695940535,
0.5232582347,
0.1101639205, 0.0000000000,
0.0097680540,
0.0075408094,
4.2314204599,
0.0082993863,
0.0060063585,
0.0000000000,
0.0000000000,
0.0076442067,
0.4127212154,
0.0000000000,
0.0000000000,
0.0061137647, 0.0027028659,
0.1421516497,
0.0000000000,
0.0000000000,
0.0006394302,
0.0004174259,
0.0084670378,
0.0000000000,
0.0102579245,
0.0000000000,
0.0097535151,
0.0000000000,
0.0000000091, 22.0713261440,
52.8548074123,
87.4350424152,
5.5343470971,
8.5458130239,
0.0026243365,
0.0000000000,
0.6444438326,
0.0000000000,
0.0000000000,
0.4690274655,
0.0111775837,
0.0000000000, 0.7853068895,
0.5804301701,
0.0000000000,
241.7223774962,
0.0852474584,
0.0000000000,
0.0000000000,
0.0000000000,
0.0046043128,
0.0000000000,
0.0000000000,
0.0000000000,
0.0092126667, 0.1907664071,
1.1388072940,
0.0069950673,
0.0000000000,
3.2949756637,
0.0097480604,
0.0114461871,
0.0101092121,
0.0120198795,
0.0000000000,
0.0102984460,
0.0000000000,
0.0003411392, 77.8638757528,
4.9774136371,
5.7998312546,
0.0000000000,
32.6107435348,
0.0000000000,
0.0000000000,
7.3147158634,
0.0000000000,
112.3320506295,
6.5803001760,
0.9144713387,
0.0800661074, 0.6380873029,
3.4344996615,
0.0000000000,
7.9969790535,
4.0547889928,
1.2673476404,
7.9809497222,
8.8252344733,
0.0000000000,
190.1707930678,
0.0000000000,
0.0042434316,
0.0000117426, 42.4928921475,
1.8499402382,
18.0908263404,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0022710707,
0.0000000000,
0.0000000000,
0.0068807271,
0.1494089476,
0.0001752242, 396.2394144642,
33.6112684912,
0.0053195470,
331.9368790619,
437.6418006190,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
15.5115983050,
0.0052803584,
0.0703659816, 112.4036508580,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0073096632,
0.0000000000,
0.0091600012,
0.0000000000,
0.0000000000,
0.0072861510,
0.0493312705,
0.0049937361, 1.6405231709,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000, 1.8173590152,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
28.5681479205, 0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000, 0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000, 0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
1.7833707251,
0.0000000000, 0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
17.5252532711,
0.0000000000, 0.0000000000,
31.1123311855,
0.0000000000,
0.0000000000,
3.4969161675,
0.0000000000, 0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000, 0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
3.4593661665,
0.0000000000, 56.7768222287,
0.0000000000,
0.0000000000,
0.0000000000,
5.3758924006,
0.0000000000, 0.0000000000,
1.6125342576,
47.2133536610,
0.0000000000,
0.0000000000,
0.0000000000, 0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000, ];
#[allow(clippy::excessive_precision)]
pub static WEIGHTS_PREVIEW_V0_2: [f64; 228] = [
0.0000000000,
0.0374713114,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0002534408,
0.0022940503,
64.5319059554,
0.0025568180,
0.0024655971,
0.0001182877, 5.0947987726,
0.6253588192,
0.0036665038,
0.0012089836,
15.7983738285,
0.0005742272,
0.0000000000,
0.5175522882,
0.0017844759,
0.0000000000,
1.3480049939,
1.4246254310,
0.0302900947, 0.0000000000,
0.0030975336,
0.0021003750,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0025534968,
69.2987507117,
0.0000000000,
0.0000000000,
0.0020508776, 0.0006647708,
0.0000000000,
0.0000000000,
0.0000000000,
0.0001735594,
0.0001311405,
0.0022817212,
0.0000000000,
0.0024169014,
16.1367160769,
0.0028778096,
0.0000000000,
0.0001602903, 94.6093105684,
14.2170395553,
35.3539050513,
1.3630743451,
68.1526923123,
0.0008809755,
0.0000000000,
0.2013576637,
0.0000000000,
0.0000000000,
0.1249634554,
0.0035217432,
0.0498144992, 0.2131147170,
1.7331839707,
0.0000000000,
61.9252606811,
0.0217888369,
0.0000000000,
0.0000000000,
0.0000000000,
0.0011283888,
69.6715917151,
0.0000000000,
0.0000000000,
0.0030681356, 0.0508113272,
0.0000000000,
0.0022822823,
0.0000000000,
1.0470138384,
0.0030747304,
0.0031241737,
0.0026097417,
0.0035396334,
64.5861323041,
0.0025540825,
0.0000000000,
0.0000861748, 21.9866716620,
1.6042001813,
1.6650862341,
177.6428823130,
8.8094144980,
74.3890350730,
0.0000000000,
2.4416214848,
0.0000000000,
0.0000000000,
7.6251827816,
2.3284049327,
0.0254137606, 0.1682704477,
0.0000000000,
0.0000000000,
2.1893370574,
1.3307404051,
0.3266457358,
1.9962771956,
2.5501952064,
0.0000000000,
61.8997311172,
0.0000000000,
0.0013826336,
0.0000029596, 0.0000000000,
0.0000000000,
0.0000000000,
31.5515340494,
0.0000000000,
0.0000000000,
0.0000000000,
0.0006549325,
0.0000000000,
64.6916010441,
0.0023106921,
0.0407007643,
0.0000418198, 117.9545428313,
8.0998531896,
0.0015372472,
771.7280930717,
6.7617998299,
277.1059304530,
396.4838353042,
0.0000000000,
0.0000000000,
13.9788488769,
4.8576545185,
8.6129380883,
0.0182069151, 27.1648870672,
3.0652861197,
0.8003146330,
315.2451919583,
43.9295462389,
0.0023695407,
0.0000000000,
0.0022416240,
0.0000000000,
72.4855222582,
0.0024129895,
0.1189369864,
0.0014196010, 0.4487279165,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000, 0.4482423487,
1.7175745862,
0.0000000000,
0.0000000000,
0.0000000000,
8.3046937974, 0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000, 0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000, 0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
0.5506673335,
0.0000000000, 0.0000000000,
0.0000000000,
0.0000000000,
0.0000000000,
5.5320293663,
0.0000000000, 0.0000000000,
8.0037734436,
0.0000000000,
0.0000000000,
1.0761444814,
0.0000000000, 1.5371198008,
0.0000000000,
0.0000000000,
2.8277784618,
0.0000000000,
0.0000000000, 1.6209056242,
0.0000000000,
0.0000000000,
0.0000000000,
0.9606478120,
0.0000000000, 13.6786977377,
0.0000000000,
0.0000000000,
0.0000000000,
1.7799580769,
0.0000000000, 1.6034688535,
0.4040027990,
13.5194607333,
2.6215292388,
0.0000000000,
0.0000000000, 1.6611285265,
6.9307627972,
0.0000000000,
0.7474376328,
12.8104312758,
0.0000000000, ];