27 if (
a >
b) std::swap(
a,
b);
36std::string normalizeToken(
const std::string&
name) {
41 for (
size_t i =
begin; i <
name.size(); ++i) {
42 const unsigned char c =
static_cast<unsigned char>(
name[i]);
43 if (std::isalnum(
c))
out.push_back(
static_cast<char>(std::tolower(
c)));
48int matchJoint(
const AnimSkeleton*
source,
const AnimSkeleton*
target,
int targetBone) {
49 const int exact =
source->findBone(
target->getBoneName(targetBone));
50 if (exact >= 0)
return exact;
51 const std::string want = normalizeToken(
target->getBoneName(targetBone));
53 if (normalizeToken(
source->getBoneName(
bone)) == want)
return bone;
62 const float x2 =
x +
x, y2 =
y +
y, z2 =
z +
z;
63 const float xx =
x * x2, xy =
x * y2, xz =
x * z2;
64 const float yy =
y * y2, yz =
y * z2, zz =
z * z2;
65 const float wx =
w * x2,
wy =
w * y2,
wz =
w * z2;
66 out[0] = 1.f - (yy + zz);
70 out[4] = 1.f - (xx + zz);
75 float c0[3] = {in[0], in[1], in[2]};
76 float c1[3] = {in[3], in[4], in[5]};
77 auto normalize = [](
float*
v) {
78 const float n = std::sqrt(
v[0] *
v[0] +
v[1] *
v[1] +
v[2] *
v[2]);
90 const float dot = c0[0] * c1[0] + c0[1] * c1[1] + c0[2] * c1[2];
95 const float c2[3] = {c0[1] * c1[2] - c0[2] * c1[1], c0[2] * c1[0] - c0[0] * c1[2], c0[0] * c1[1] - c0[1] * c1[0]};
96 const float m00 = c0[0], m01 = c1[0], m02 = c2[0];
97 const float m10 = c0[1], m11 = c1[1], m12 = c2[1];
98 const float m20 = c0[2], m21 = c1[2], m22 = c2[2];
99 const float trace = m00 + m11 + m22;
101 const float s = 0.5f / std::sqrt(
trace + 1.f);
103 qx = (m21 - m12) *
s;
104 qy = (m02 - m20) *
s;
105 qz = (m10 - m01) *
s;
106 }
else if (m00 > m11 && m00 > m22) {
107 const float s = 2.f * std::sqrt(1.f + m00 - m11 - m22);
108 qw = (m21 - m12) /
s;
110 qy = (m01 + m10) /
s;
111 qz = (m02 + m20) /
s;
112 }
else if (m11 > m22) {
113 const float s = 2.f * std::sqrt(1.f + m11 - m00 - m22);
114 qw = (m02 - m20) /
s;
115 qx = (m01 + m10) /
s;
117 qz = (m12 + m21) /
s;
119 const float s = 2.f * std::sqrt(1.f + m22 - m00 - m11);
120 qw = (m10 - m01) /
s;
121 qx = (m02 + m20) /
s;
122 qy = (m12 + m21) /
s;
139 const AnimSkin* ,
int ringsPerBone,
int pointsPerRing) {
140 if (!sourceSkeleton || !targetSkeleton)
throw Exception(
"buildSmrFeatures: skeleton is null");
146 batch.
jointMap[
static_cast<size_t>(
t)] = matchJoint(sourceSkeleton, targetSkeleton,
t);
170 std::vector<float> sourceRest;
171 std::vector<float> targetRest;
174 for (
int i = 0; i < batch.
sensors; ++i) {
175 for (
int k = 0; k < 3; ++k) {
176 batch.
sourceGeom[
static_cast<size_t>(i) * 7u +
static_cast<size_t>(k)] =
177 sourceRest[
static_cast<size_t>(i) * 3u +
static_cast<size_t>(k)];
178 batch.
targetGeom[
static_cast<size_t>(i) * 7u +
static_cast<size_t>(k)] =
179 targetRest[
static_cast<size_t>(i) * 3u +
static_cast<size_t>(k)];
188 std::vector<std::pair<int, int>> pairIdx;
190 for (
int a = 0;
a < sensorLimit; ++
a) {
191 for (
int b =
a + 1;
b < sensorLimit; ++
b) {
195 batch.
pairs =
static_cast<int>(pairIdx.size());
201 batch.
sourceDmi.assign(
static_cast<size_t>(batch.
frames) *
static_cast<size_t>(std::max(batch.
pairs, 1)) * 10u,
205 std::vector<float> xyz;
206 std::vector<float> prevXyz;
210 :
duration *
static_cast<float>(
frame) /
static_cast<float>(std::max(batch.
frames - 1, 1));
212 pose.computeWorld(sourceSkeleton);
213 for (
int joint = 0; joint < batch.
joints; ++joint) {
214 const int sourceJoint = batch.
jointMap[
static_cast<size_t>(joint)];
215 float rot[6] = {1.f, 0.f, 0.f, 0.f, 1.f, 0.f};
216 if (sourceJoint >= 0) {
221 (
static_cast<size_t>(
frame) *
static_cast<size_t>(batch.
joints) +
static_cast<size_t>(joint)) * 6u;
222 for (
int k = 0; k < 6; ++k) batch.
sourceRot6d[base +
static_cast<size_t>(k)] = rot[k];
225 for (
int p = 0;
p < batch.
pairs; ++
p) {
226 const int a = pairIdx[
static_cast<size_t>(
p)].
first;
227 const int b = pairIdx[
static_cast<size_t>(
p)].
second;
228 const float ax = xyz[
static_cast<size_t>(
a) * 3u];
229 const float ay = xyz[
static_cast<size_t>(
a) * 3u + 1u];
230 const float az = xyz[
static_cast<size_t>(
a) * 3u + 2u];
231 const float bx = xyz[
static_cast<size_t>(
b) * 3u];
232 const float by = xyz[
static_cast<size_t>(
b) * 3u + 1u];
233 const float bz = xyz[
static_cast<size_t>(
b) * 3u + 2u];
234 const float dx = bx - ax,
dy = by - ay,
dz = bz - az;
235 const float dist = std::sqrt(
dx *
dx +
dy *
dy +
dz *
dz);
236 float vx = 0.f,
vy = 0.f,
vz = 0.f;
237 if (!prevXyz.empty()) {
238 vx = (bx - prevXyz[
static_cast<size_t>(
b) * 3u]) - (ax - prevXyz[
static_cast<size_t>(
a) * 3u]);
240 (by - prevXyz[
static_cast<size_t>(
b) * 3u + 1u]) - (ay - prevXyz[
static_cast<size_t>(
a) * 3u + 1u]);
242 (bz - prevXyz[
static_cast<size_t>(
b) * 3u + 2u]) - (az - prevXyz[
static_cast<size_t>(
a) * 3u + 2u]);
245 (
static_cast<size_t>(
frame) *
static_cast<size_t>(batch.
pairs) +
static_cast<size_t>(
p)) * 10u;
268void gemm(
const float*
a,
const float*
b,
float*
c,
int m,
int k,
int n) {
269 for (
int i = 0; i <
m; ++i)
270 for (
int j = 0; j <
n; ++j) {
272 for (
int t = 0;
t < k; ++
t) sum +=
a[i * k +
t] *
b[
t *
n + j];
277void addBias(
float*
x,
const float*
bias,
int rows,
int cols) {
282void gelu(
float*
x,
int n) {
283 for (
int i = 0; i <
n; ++i) {
284 const float v =
x[i];
285 x[i] = 0.5f *
v * (1.f + std::tanh(0.7978845608f * (
v + 0.044715f *
v *
v *
v)));
290 for (
int r = 0;
r <
rows; ++
r) {
293 for (
int c = 0;
c <
cols; ++
c) mean += row[
c];
294 mean /=
static_cast<float>(
cols);
296 for (
int c = 0;
c <
cols; ++
c) {
297 const float d =
row[
c] - mean;
300 var = 1.f / std::sqrt(var /
static_cast<float>(
cols) + 1e-5f);
301 for (
int c = 0;
c <
cols; ++
c) row[
c] = (row[
c] - mean) * var *
g[
c] +
b[
c];
305void softmaxRows(
float*
x,
int rows,
int cols) {
306 for (
int r = 0;
r <
rows; ++
r) {
309 for (
int c = 1;
c <
cols; ++
c) mx = std::max(mx, row[
c]);
311 for (
int c = 0;
c <
cols; ++
c) {
312 row[
c] = std::exp(row[
c] - mx);
315 const float inv = 1.f / std::max(sum, 1e-8f);
316 for (
int c = 0;
c <
cols; ++
c) row[
c] *= inv;
320std::vector<float> xavier(std::mt19937& rng,
int rows,
int cols) {
321 std::normal_distribution<float> dist(0.f, std::sqrt(2.f /
static_cast<float>(
rows +
cols)));
322 std::vector<float>
out(
static_cast<size_t>(
rows *
cols));
323 for (
float&
v :
out)
v = dist(rng);
327std::vector<float>
zeros(
int n) {
return std::vector<float>(
static_cast<size_t>(
n), 0.f); }
328std::vector<float> ones(
int n) {
return std::vector<float>(
static_cast<size_t>(
n), 1.f); }
330std::vector<float> mlp2(
const float*
x,
int rows,
int inDim,
int mid,
int outDim,
const std::vector<float>& w1,
331 const std::vector<float>& b1,
const std::vector<float>& w2,
const std::vector<float>& b2) {
332 std::vector<float>
h(
static_cast<size_t>(
rows *
mid));
333 gemm(
x, w1.data(),
h.data(),
rows, inDim,
mid);
334 addBias(
h.data(), b1.data(),
rows,
mid);
336 std::vector<float>
y(
static_cast<size_t>(
rows * outDim));
337 gemm(
h.data(), w2.data(),
y.data(),
rows,
mid, outDim);
338 addBias(
y.data(), b2.data(),
rows, outDim);
342std::vector<float> maxPool(
const std::vector<float>&
x,
int groups,
int count,
int dim) {
343 std::vector<float>
out(
static_cast<size_t>(
groups * dim), -1e30f);
345 for (
int i = 0; i <
count; ++i)
346 for (
int d = 0;
d < dim; ++
d) {
347 const float v =
x[
static_cast<size_t>((
g *
count + i) * dim +
d)];
348 float&
slot =
out[
static_cast<size_t>(
g * dim +
d)];
352 if (
v < -1e29f)
v = 0.f;
356void transformerLayer(std::vector<float>&
x,
int tokens,
int dim,
int heads,
const std::vector<float>& wq,
357 const std::vector<float>& wk,
const std::vector<float>& wv,
const std::vector<float>& wo,
358 const std::vector<float>& w1,
const std::vector<float>& b1,
const std::vector<float>& w2,
359 const std::vector<float>& b2,
const std::vector<float>& ln1g,
const std::vector<float>& ln1b,
360 const std::vector<float>& ln2g,
const std::vector<float>& ln2b,
const std::vector<float>*
memory,
362 const int headDim = std::max(1, dim / std::max(heads, 1));
364 std::vector<float> residual =
x;
366 std::vector<float>
q(
static_cast<size_t>(
tokens * dim));
367 std::vector<float> k(
static_cast<size_t>(srcTokens * dim));
368 std::vector<float>
v(
static_cast<size_t>(srcTokens * dim));
369 gemm(
x.data(), wq.data(),
q.data(),
tokens, dim, dim);
371 gemm(src, wk.data(), k.data(), srcTokens, dim, dim);
372 gemm(src, wv.data(),
v.data(), srcTokens, dim, dim);
373 std::vector<float> ctx(
static_cast<size_t>(
tokens * dim), 0.f);
374 const float scale = 1.f / std::sqrt(
static_cast<float>(headDim));
375 for (
int h = 0;
h < heads; ++
h) {
376 std::vector<float> scores(
static_cast<size_t>(
tokens * srcTokens));
378 for (
int s = 0;
s < srcTokens; ++
s) {
380 for (
int d = 0;
d < headDim; ++
d)
381 sum +=
q[
static_cast<size_t>(
t * dim +
h * headDim +
d)] *
382 k[
static_cast<size_t>(
s * dim +
h * headDim +
d)];
383 scores[
static_cast<size_t>(
t * srcTokens +
s)] = sum *
scale;
385 softmaxRows(scores.data(),
tokens, srcTokens);
387 for (
int d = 0;
d < headDim; ++
d) {
389 for (
int s = 0;
s < srcTokens; ++
s)
390 sum += scores[
static_cast<size_t>(
t * srcTokens +
s)] *
391 v[
static_cast<size_t>(
s * dim +
h * headDim +
d)];
392 ctx[
static_cast<size_t>(
t * dim +
h * headDim +
d)] = sum;
395 std::vector<float> projected(
static_cast<size_t>(
tokens * dim));
396 gemm(ctx.data(), wo.data(), projected.data(),
tokens, dim, dim);
397 for (
size_t i = 0; i <
x.size(); ++i)
x[i] = residual[i] + projected[i];
400 auto ff = mlp2(
x.data(),
tokens, dim,
static_cast<int>(b1.size()), dim, w1, b1, w2, b2);
401 for (
size_t i = 0; i <
x.size(); ++i)
x[i] = residual[i] + ff[i];
408void SmrMeshRetNet::initWeights() {
409 std::mt19937 rng(
static_cast<uint32_t
>(config_.
seed));
411 geomW1_ = xavier(rng, 7,
d);
413 geomW2_ = xavier(rng,
d,
d);
415 dmiW1_ = xavier(rng, 10,
d);
417 dmiW2_ = xavier(rng,
d,
d);
419 motionW_ = xavier(rng, 6,
d);
421 fuseW_ = xavier(rng,
d * 3,
d);
423 outW_ = xavier(rng,
d, 6);
425 auto fill = [&](std::vector<LayerWeights>& layers) {
426 layers.assign(
static_cast<size_t>(config_.
numLayers), {});
427 for (
auto&
layer : layers) {
444 tensor::Tensor probe(
d);
455 const int T = features.
frames;
456 const int J = features.
joints;
457 const int S = std::max(features.
sensors, 1);
458 const int P = std::max(features.
pairs, 1);
459 const int heads = std::max(1, config_.
numHeads);
461 auto srcGeom = mlp2(features.
sourceGeom.data(), S, 7,
d,
d, geomW1_, geomB1_, geomW2_, geomB2_);
462 auto tgtGeom = mlp2(features.
targetGeom.data(), S, 7,
d,
d, geomW1_, geomB1_, geomW2_, geomB2_);
463 auto srcPool = maxPool(srcGeom, 1, S,
d);
464 auto tgtPool = maxPool(tgtGeom, 1, S,
d);
466 std::vector<float> temporal(
static_cast<size_t>(T *
d), 0.f);
467 for (
int t = 0;
t < T; ++
t) {
468 const float* dmiFrame = features.
sourceDmi.data() +
static_cast<size_t>(
t) *
static_cast<size_t>(P) * 10u;
469 auto dmiEnc = mlp2(dmiFrame, P, 10,
d,
d, dmiW1_, dmiB1_, dmiW2_, dmiB2_);
470 auto dmiPool = maxPool(dmiEnc, 1, P,
d);
471 std::vector<float> meanRot(6, 0.f);
472 for (
int j = 0; j < J; ++j) {
473 const float*
r = features.
sourceRot6d.data() +
static_cast<size_t>((
t * J + j) * 6);
474 for (
int k = 0; k < 6; ++k) meanRot[static_cast<size_t>(k)] +=
r[k];
476 for (
float&
v : meanRot)
v /=
static_cast<float>(std::max(J, 1));
477 std::vector<float> motion(
static_cast<size_t>(
d), 0.f);
478 gemm(meanRot.data(), motionW_.data(), motion.data(), 1, 6,
d);
479 addBias(motion.data(), motionB_.data(), 1,
d);
480 std::vector<float> fusedIn(
static_cast<size_t>(
d * 3));
481 for (
int i = 0; i <
d; ++i) {
482 fusedIn[
static_cast<size_t>(i)] = dmiPool[
static_cast<size_t>(i)];
483 fusedIn[
static_cast<size_t>(
d + i)] = motion[
static_cast<size_t>(i)];
484 fusedIn[
static_cast<size_t>(2 *
d + i)] = srcPool[
static_cast<size_t>(i)];
486 std::vector<float> fused(
static_cast<size_t>(
d));
487 gemm(fusedIn.data(), fuseW_.data(), fused.data(), 1,
d * 3,
d);
488 addBias(fused.data(), fuseB_.data(), 1,
d);
489 for (
int i = 0; i < d; ++i) temporal[static_cast<size_t>(
t *
d + i)] = fused[
static_cast<size_t>(i)];
492 std::vector<float>
memory = temporal;
493 for (
const auto&
layer : enc_)
494 transformerLayer(
memory, T,
d, heads,
layer.wq,
layer.wk,
layer.wv,
layer.wo,
layer.w1,
layer.b1,
layer.w2,
497 std::vector<float> queries(
static_cast<size_t>(T *
d));
498 for (
int t = 0;
t < T; ++
t)
499 for (
int i = 0; i <
d; ++i)
500 queries[
static_cast<size_t>(
t *
d + i)] =
501 tgtPool[
static_cast<size_t>(i)] + temporal[
static_cast<size_t>(
t *
d + i)];
502 for (
const auto&
layer : dec_)
503 transformerLayer(queries, T,
d, heads,
layer.wq,
layer.wk,
layer.wv,
layer.wo,
layer.w1,
layer.b1,
layer.w2,
506 std::vector<float>
out(
static_cast<size_t>(T * J * 6));
507 for (
int t = 0;
t < T; ++
t) {
508 std::vector<float> delta(6, 0.f);
509 gemm(queries.data() +
static_cast<size_t>(
t *
d), outW_.data(), delta.data(), 1,
d, 6);
510 addBias(delta.data(), outB_.data(), 1, 6);
511 for (
int j = 0; j < J; ++j) {
512 const float* src = features.
sourceRot6d.data() +
static_cast<size_t>((
t * J + j) * 6);
513 float* dst =
out.data() +
static_cast<size_t>((
t * J + j) * 6);
514 for (
int k = 0; k < 6; ++k) dst[k] = src[k] + 0.05f * delta[
static_cast<size_t>(k)];
528 if (!profile)
return true;
531 if (
backend ==
"onnx")
return ensureOnnx(*profile).
ok();
532 if (
backend ==
"tensor")
return true;
551Result<SmrNeuralResult> SmrNeuralProvider::applyRot6d(
const SmrNeuralRequest&
request,
const SmrFeatureBatch& features,
552 const std::vector<float>& rot6d,
553 const std::string&
backend)
const {
558 if (
static_cast<int>(rot6d.size()) < features.frames * features.joints * 6) {
565 for (
int joint = 0; joint < features.joints; ++joint) {
566 clip.clearTrack(joint);
570 static_cast<float>(std::max(features.frames - 1, 1));
571 const float* r6 = rot6d.data() +
static_cast<size_t>((
frame * features.joints + joint) * 6);
572 float qx = 0.f,
qy = 0.f,
qz = 0.f,
qw = 1.f;
579 result.framesWritten = features.frames;
581 result.sensorCount =
static_cast<size_t>(features.sensors);
582 result.pairCount =
static_cast<size_t>(features.pairs);
596 const std::string& backendHint =
request.profile->getNeuralBackend();
597 const bool preferOnnx =
598 backendHint ==
"onnx" || (backendHint !=
"tensor" && !
request.profile->getNeuralModelPath().empty());
600 auto ready = ensureOnnx(*
request.profile);
602 auto ran = onnx_.
run(features);
603 if (ran.ok())
return applyRot6d(
request, features, ran.value(),
"onnx");
605 }
else if (backendHint ==
"onnx") {
610 auto ran = net_.
forward(features);
612 return applyRot6d(
request, features, ran.value(),
"tensor-meshret");
626 named.
tensor.
bytes.resize(data.size() *
sizeof(
float));
636 model_ = std::move(
loaded.value());
641 std::ifstream
file(
path, std::ios::binary | std::ios::ate);
645 const auto size =
static_cast<std::streamoff
>(
file.tellg());
650 std::vector<uint8_t>
bytes(
static_cast<size_t>(
size));
652 if (!
file.read(
reinterpret_cast<char*
>(
bytes.data()),
static_cast<std::streamsize
>(
bytes.size()))) {
659 if (!model_)
return {};
660 return model_->info();
672 const int64_t T = features.
frames;
673 const int64_t J = features.
joints;
674 const int64_t S = std::max(features.
sensors, 1);
675 const int64_t P = std::max(features.
pairs, 1);
677 std::vector<tensor::OnnxNamedTensor> feeds;
678 feeds.push_back(makeF32(
"source_rot6d", {1, T, J, 6}, features.
sourceRot6d));
679 feeds.push_back(makeF32(
"source_geom", {1, S, 7}, features.
sourceGeom));
680 feeds.push_back(makeF32(
"target_geom", {1, S, 7}, features.
targetGeom));
681 feeds.push_back(makeF32(
"source_dmi", {1, T, P, 10}, features.
sourceDmi));
683 const std::string outName =
"target_rot6d";
684 auto ran = model_->run(feeds, std::span<const std::string>(&outName, 1));
686 if (ran.value().empty()) {
690 const auto&
bytes = ran.value()[0].tensor.bytes;
691 std::vector<float>
out(
bytes.size() /
sizeof(
float));
692 if (!
out.empty()) std::memcpy(
out.data(),
bytes.data(),
out.size() *
sizeof(
float));
eve::EntitySpatialPose pose
Stable, structured diagnostics shared by engine modules.
const GltfImportRequest & request
vk::UniqueDeviceMemory memory
std::array< double, 10 > q
std::array< float, 3 > scale
OceanRenderBackend backend
std::vector< int64_t > zeros
std::unordered_set< std::string > loaded
std::vector< Token > tokens
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
EVENGINE_API_FOUNDATION public API.
bool ok() const noexcept
Whether this result represents a non-failure outcome.
Move-only operation result carrying either a value or Status.
static Result success(T value)
Construct a successful result owning value.
static Result failure(Status status)
Construct a failed result from a structured status.
Keyframed skeletal animation clip (local TRS tracks per bone). Script type: AnimClip.
float getDuration() const
Returns the duration.
void sample(float time, AnimPose *out, const AnimSkeleton *skeleton=nullptr) const
Sample local pose at time (seconds). If skeleton non-null, missing tracks fall back to bind pose; oth...
float getSampleRate() const
Returns the sample rate.
Evaluated local (and optional world) pose for an AnimSkeleton. Script type: AnimPose.
void computeWorld(const AnimSkeleton *skeleton)
Compute world transforms from local pose + skeleton hierarchy. World values readable via getWorld* af...
Settings and diagnostics for offline skeletal animation retargeting.
const std::string & getNeuralBackend() const
Return the neural backend hint.
const std::string & getNeuralModelPath() const
Return the configured neural model path (may be empty).
bool getNeuralRetargetEnabled() const
Return whether neural retarget is preferred when a provider is available.
3D bone hierarchy + bind-pose local TRS for skeletal animation. Independent of ik::Skeleton3D (FABRIK...
int getBoneCount() const
Returns the bone count.
void applyBindPose(class AnimPose *pose) const
Fill pose locals with bind pose.
CPU linear-blend skinning binding for one mesh against an AnimSkeleton.
Bone-attached sensor cloud for skinned-motion-retarget interaction queries. Script type: AnimSmrSenso...
AnimSmrBodyPart getSensorPart(int index) const
Returns the sensor part.
void evaluateWorldPositions(const AnimPose *pose, std::vector< float > &outXYZ) const
Evaluate world-space sensor positions for a pose that already has computeWorld() applied.
int getSensorCount() const
Returns the sensor count.
static AnimSmrSensorCloud fromSkeletonDense(const AnimSkeleton *skeleton, int ringsPerBone, int pointsPerRing)
Build denser MeshRet-style SCS rings around each bone segment.
const AnimSmrSensor & getSensor(int index) const
Returns the sensor.
SmrMeshRetNet(SmrMeshRetConfig config={})
Constructs a SmrMeshRetNet.
Result< std::vector< float > > forward(const SmrFeatureBatch &features) const
Owning target rot6d [T*J*6], or structured failure.
std::string name() const override
Name.
Result< SmrNeuralResult > retarget(const SmrNeuralRequest &request) override
Run inference and rewrite request.targetClip local rotations. @lifetime See SmrNeuralRequest; pointer...
bool isReady(const AnimRetargetProfile *profile) const override
True when ONNX is loadable for the profile path, or builtin MeshRet is usable.
tensor::OnnxModelInfo info() const
Info.
Result< void > loadFile(const std::string &path)
Loads file.
Result< void > load(std::span< const uint8_t > bytes)
Loads .
Result< std::vector< float > > run(const SmrFeatureBatch &features) const
Run.
static Result< std::unique_ptr< OnnxModel > > load(std::span< const uint8_t > bytes)
Import bounded in-memory ONNX ModelProto; copies all retained data.
AnimSmrBodyPart
Coarse body-part tag used to select MeshRet-style interaction pairs.
SmrFeatureBatch buildSmrFeatures(const AnimClip &sourceClip, const AnimSkeleton *sourceSkeleton, const AnimSkeleton *targetSkeleton, const AnimSkin *, const AnimSkin *, int ringsPerBone, int pointsPerRing)
Build dense SCS + DMI tensors from skeletons/clip (no tensor headers).
void rot6dToQuat(const float in[6], float &qx, float &qy, float &qz, float &qw)
Convert rotation-6D back to a unit quaternion.
void quatToRot6d(float qx, float qy, float qz, float qw, float out[6])
Convert unit quaternion to MeshRet-style rotation-6D.
void layernorm(const float *in, int rows, int cols, const float *scale, const float *bias, float eps, float *out)
Layernorm.
WidgetDesc row(std::vector< WidgetDesc > children, std::string id)
Horizontal elastic layout row.
WidgetDesc separator(std::string id)
Horizontal separator line.
Packed MeshRet-style features for one retarget inference window.
std::vector< float > targetGeom
[S*7]
std::vector< float > sourceRot6d
[T*J*6]
std::vector< float > sourceDmi
[T*P*10]
std::vector< int > jointMap
target joint -> source joint (-1 if unmatched)
std::vector< float > sourceGeom
[S*7]
Hyperparameters for the builtin MeshRet-style graph.
Inputs for neural MeshRet-style skinned motion retarget.
Owning admission report; unsupported nodes remain inspectable but cannot execute.
Owning named feed/output value.
std::vector< int64_t > shape
std::vector< uint8_t > bytes