The
libs/aja/area: forty Nx libraries that make up the motion-capture → 3D-pose → retargeting → avatar-animation pipeline behind Lilith's embodied instruction product (yoga / fitness / dance / martial-arts coaching avatars), plus the distributed-processing and content-governance layers that wrap it.
What this area is#
"Aja" is the deity-named domain for Lilith's motion pipeline: turning video
or sensor capture of a human performer into clean, retargeted, avatar-ready 3D
animation. The forty libraries under libs/aja/ are not one package but a
layered cluster, and they split into roughly six bands that mirror the data flow
of a capture-to-avatar pipeline:
- Capture & reconstruction —
depth-sensing,multi-view-reconstruction,human-mesh-recovery,pose-lifting: get 2D/RGB-D observations up into 3D keypoints, meshes, and SMPL bodies. - Motion data & quality —
motion-formats,motion-processing,motion-quality,motion-validation: parse/convert mocap formats, clean the signal, and score it against ground truth (MPJPE/PA-MPJPE/PCK). - Retargeting —
skeleton-mapping,neural-retargeting,semantic-retargeting,proportional-adaptation,optimization-ik,blend-shape-retargeting: move a captured motion onto a different skeleton or face rig while preserving intent, proportions, and contact. - Animation & avatars —
animation-blending,fitness-animation,generative-animation,avatar-library,avatar-integration,avatar-preview-ui,bone-mapping-ui: the runtime animation systems and the avatar/instructor catalog plus its React tooling. - Distributed processing infra —
batch-inference,distributed-workers,pipeline-parallelism,pipeline-cache,video-chunking,result-aggregation,model-optimization,asset-storage: scale the heavy inference stages out across GPUs/workers and cache/store the intermediates. - Governance & compliance —
consent-management,content-moderation,content-security,content-watermarking,data-retention,privacy-protection: consent, scanning, encryption, watermarking, retention, and face anonymization for biometric/likeness data. - SDK & cross-domain integration —
motion-pipeline-sdk,motion-integration,domain-motion-pipelines,film-pipeline,cg-replacement: the typed client, the adapters to sibling domains, and the domain-specific analysis/delivery pipelines.
Most of these are substantial TypeScript libraries (several thousand LOC each;
fitness-animation is ~28K LOC across 40 modules). A note on naming: the
project.json name fields are inconsistent — some are @aja/*, some aja-*,
and several are lilith-* (e.g. lilith-motion-formats,
lilith-neural-retargeting) — and the tag scopes likewise mix scope:aja and
scope:lilith. This reflects the area's history as the Lilith motion stack
later organized under the Aja domain name; the headings below use each
project.json's exact name.
Honesty note on the ML-heavy libraries.
The neural / model-optimization / capture libraries implement real geometry,
tensor math, data structures, and pipeline orchestration, but draw an explicit
seam at the heavy learned/native stage. neural-retargeting takes an
injectable ONNX Runtime (ONNXInferenceSession/ONNXTensor interfaces in
inference.ts) and falls back to linear-interpolation retargeting when no model
is loaded. model-optimization's TensorRT compile path and
human-mesh-recovery's detection/regression backbone are explicitly labelled
as simulated in-source ("Build the engine (simulated …)", "(simulated neural
network)"), and distributed-workers' Kubernetes client simulates the API
calls rather than binding a live cluster. These are honest, labelled seams — the
surrounding algorithms (graph layers, SMPL math, autoscaling, fusion patterns)
are real — but they are not running production GPU inference here, and the
entity blocks call that out where it applies.
How it fits the wider system#
These libraries are consumed by the Lilith product and BFF. Externally, the
typed entry point is @aja/motion-pipeline-sdk (a client over the Lilith Motion
Pipeline Service). Cross-domain, @aja/motion-integration carries per-domain
adapters that push pipeline outputs into Yemaya (Creative Studio), Isis,
Bellona, and Sophia, while @aja/domain-motion-pipelines types the
relationship between movement pipelines and Metis embodied-instruction
learning moments. @aja/film-pipeline and @aja/cg-replacement extend the same
core toward film/VFX delivery and video-to-CG character replacement. Internally
the libraries compose along the bands above — e.g. film-pipeline imports
AnimationClip/MotionFormat from @aja/motion-formats, and the retargeting
band consumes skeleton-mapping templates. Walk the "used by" edges on any node
to see its exact consumers.
Entity catalog (41)#
The 41 tracked Nx projects in aja, each a code-linked entity node — package, type, source path, declared targets, and its internal dependency graph (depends-on / used-by, resolved from the package manifests, §6/§8), read from the project graph. Grouped by architectural layer; walk the dependency links to travel the system. 40 of these carry an authored deep-dive (what / why / how it fits); the rest are generated scaffolds awaiting one.
domain (27)#
Advanced animation blending system for avatars
Runtime animation-blending library for Lilith avatars
(libs/aja/animation-blending/src). It provides idle blending
(idle-blending.ts), clip transitions (clip-transitions.ts), additive layers
(additive-layers.ts), and body-part masking (body-masks.ts) over a real
vector/quaternion math kernel in blend-utils.ts (slerp, additive-difference
transforms, 1D/2D blend-weight calculation, ping-pong/wrap time utilities). This
is the playback-side animation mixer, not a capture stage.
addVec320subtractVec320scaleVec320magnitudeVec320normalizeVec320normalizeQuat20multiplyQuat20invertQuat20IDENTITY_QUAT20ZERO_VEC320ONE_VEC320addTransform20computeAdditiveDifference20applyAdditiveFrame20 +43 moreThe teacher-avatar integration layer (libs/aja/avatar-integration/src) that
connects motion-capture data to instructor avatars. It ships concrete pipelines
for yoga (yoga-pipeline.ts, with breath visualization), fitness
(fitness-pipeline.ts, rep counting / form feedback), and meditation
(meditation-pipeline.ts), plus a custom-avatar.ts path for user-imported
characters, over a large shared type surface (avatar identity, skeleton, blend
shapes, pipeline stages). It is the glue between captured motion and a specific
on-screen instructor.
DEFAULT_PIPELINE_CONFIG94DEFAULT_YOGA_PIPELINE_CONFIG94DEFAULT_FITNESS_PIPELINE_CONFIG94DEFAULT_MEDITATION_PIPELINE_CONFIG94DEFAULT_CUSTOM_PIPELINE_CONFIG94createYogaPipeline108YOGA_STYLE_CHARACTERISTICS108BreathState108BreathVisualization108calculateBreathState108generateBreathBlendShapes108AlignmentGuide108YOGA_ALIGNMENT_GUIDES108calculateAlignmentScore108 +41 moreGPU-optimized batch inference for motion pipeline
GPU-oriented batch-inference scheduling for pose/motion analysis
(libs/aja/batch-inference/src). It implements frame batching
(frame-batcher.ts), multi-video batching (video-batcher.ts), a
latency/memory-driven dynamic-batch-sizer.ts, and GPU memory pooling /
OOM-recovery (memory-manager.ts), wired together by batch-scheduler.ts with
an injectable inference callback. It models the batching/scheduling control
plane; the actual model call is supplied by the caller via
setInferenceCallback.
DEFAULT_FRAME_BATCH_CONFIG134DEFAULT_VIDEO_BATCH_CONFIG134DEFAULT_DYNAMIC_BATCH_CONFIG134DEFAULT_MEMORY_CONFIG134DEFAULT_BATCH_INFERENCE_CONFIG134MemoryManager146createMemoryManager146calculateTensorBytes146createModelProfile146FrameBatcher157createFrameBatcher157reprocessFrames157reprocessFrame157stackFrames157 +12 moreBlend shape and morph target retargeting for facial expressions, muscle deformation, and secondary motion
Blend-shape / morph-target retargeting for faces and soft-body deformation
(libs/aja/blend-shape-retargeting/src). It covers facial expression transfer
(facial-expression.ts, with ARKit/FACS/viseme vocabularies in types.ts),
muscle deformation (muscle-deformation.ts), secondary motion
(secondary-motion.ts), and cloth simulation (cloth-simulation.ts), composed
in pipeline.ts. It is the face/morph counterpart to the skeletal-retargeting
band.
DEFAULT_SEMANTIC_CONFIG81DEFAULT_GEOMETRIC_CONFIG81DEFAULT_DEFORMATION_CONFIG81DEFAULT_NEURAL_CONFIG81DEFAULT_RETARGETING_CONFIG81DEFAULT_EXPRESSION_CONFIG81DEFAULT_MUSCLE_CONFIG81DEFAULT_SECONDARY_CONFIG81DEFAULT_CLOTH_CONFIG81FACS_EMOTION_PATTERNS97ARKIT_VISEME_WEIGHTS97ARKIT_REGION_SHAPES97ARKIT_SYMMETRY_PAIRS97normalizeShapeName97 +45 moreVideo-to-CG character replacement pipeline for actor segmentation, pose transfer, rendering, and compositing
Video-to-CG character-replacement primitives (libs/aja/cg-replacement/src):
actor segmentation, 3D pose extraction, facial-rig/landmark estimation,
lighting-aware rendering, compositing, shadow/reflection synthesis, and temporal
consistency. The work is concentrated in video-to-cg-pipeline.ts over a very
broad type surface in types.ts (FACS action units, lip-sync frames, depth
samples, estimated lights). It extends the motion core toward replacing an actor
in footage with a CG character rather than only animating an avatar.
CgReplacementPipeline71FACS_ACTION_UNIT_NAMES71HUMANOID_JOINT_NAMES71createCgReplacementPipeline71createDefaultFacialRig71createDefaultHumanoidRig71CgReplacementPipelineOptions71Specialized domain pipelines for yoga, fitness, dance, and martial arts motion analysis
Activity-specific motion-analysis pipelines
(libs/aja/domain-motion-pipelines/src) for yoga, fitness, dance, and martial
arts. The yoga pipeline is the deepest — asana detection (ASANA_DATABASE),
alignment analysis, breath/drishti/bandha detection, meditation-state and
pranayama recognition, and sequence tracking — with sibling
fitness-pipeline.ts, dance-pipeline.ts, and martial-arts-pipeline.ts.
metis-relationship.ts types how each pipeline maps to a Metis
embodied-instruction moment (movement→lesson-path, demonstration→study-pack,
coaching→tutoring), making this the cross-domain bridge to the learning side.
ASANA_DATABASE31AsanaDetectionService31AlignmentAnalysisService31BreathDetectionService31DrishtiDetectionService31BandhaAnalysisService31MeditationService31PranayamaService31YogaSequenceTracker31YogaPipeline31DEFAULT_YOGA_CONFIG31createYogaPipeline31EXERCISE_DATABASE56ExerciseRecognitionService56 +36 moreFilm and VFX-grade motion capture output packaging and delivery validation
A focused (single-file, ~370 LOC) film/VFX delivery builder
(libs/aja/film-pipeline/src/index.ts) built on @aja/motion-formats. Given a
clip and delivery tier (editorial / vfx-review / final-vfx / archive), it builds
per-format deliverables (USD/Alembic/FBX/BVH/glb with correct MIME types and
file naming), validates them (frame/rate/timecode/format constraints, with
final-VFX requiring USD/Alembic/FBX), computes a 0–1 deliveryScore, and emits
a versioned JSON manifest (aja-film-pipeline/v1). Small but real — a
deterministic package/validator, not a stub.
FilmDeliveryFormat3FilmDeliveryTier8FilmPipelineDeliverableRequest10FilmPipelineInput20FilmPipelineDeliverable37FilmPipelineValidationIssue55FilmPipelineOutputPackage71createFilmPipelinePackage279createDefaultFilmDeliverables326Advanced fitness animation library with extended skeletal system, physics simulation, and motion capture support
The largest library in the area (libs/aja/fitness-animation/src, ~28K LOC
across 40 modules): a full skeletal-animation engine for fitness motion. It
spans an extended skeleton (65+ joints, skeletal/), physics-based dynamics
with balance / ground-contact / impact / resistance (physics/), IK solvers
(FABRIK, CCD, Jacobian, analytical in kinematics/ik-solver.ts), FK and
procedural noise, mocap import/cleaning/retargeting (mocap/, including
BVH/C3D/FBX parsers), muscle simulation (muscle/), secondary motion, fatigue
modeling (fatigue/), and pose estimation/scoring (pose-estimation/,
MediaPipe/MoveNet adapters). A broad, real animation-and-analysis stack.
DEG_TO_RAD108RAD_TO_DEG108Vec2108lerp108smoothstep108smootherstep108degToRad108radToDeg108normalizeAngle108angleDifference108LEFT_FINGER_PARENTS134RIGHT_FINGER_PARENTS134LEFT_TOE_PARENTS134RIGHT_TOE_PARENTS134 +248 moreText-to-motion and generative animation primitives for physics-aware character animation
Text-to-motion and generative-animation primitives
(libs/aja/generative-animation/src, mostly generative-animation.ts). It
provides deterministic diffusion-plan conditioning (DiffusionDenoisingStep),
physics-aware skeleton generation with ballistic trajectories and contact
constraints, style/interaction controls, in-betweening, motion looping,
natural-language motion editing, and DCC export artifacts/payloads. The
diffusion is a deterministic plan/condition model (not a trained sampler), with
the focus on the physics and constraint synthesis around it.
GENERATED_HUMANOID_JOINT_NAMES44GenerativeAnimationPipeline44createDefaultCharacterProfile44createGenerativeAnimationPipeline44createTextToMotionDiffusionPlan44GenerativeAnimationPipelineOptions44Comprehensive model optimization library for deep learning inference including TensorRT compilation, ONNX optimization, mixed precision, and operator fusion
Inference-model optimization (libs/aja/model-optimization/src): TensorRT
compilation (tensorrt-compiler.ts), ONNX graph optimization
(onnx-optimizer.ts), mixed-precision planning (mixed-precision.ts,
FP16/BF16/ INT8/INT4), and operator fusion (operator-fusion.ts). It models the
optimization workflow — precision configs, fusion patterns, INT8 calibration —
but the TensorRT engine build is simulated (in-source: "Build the engine
(simulated — in production would use native bindings)"); there are no native
TensorRT/ONNX runtime calls here.
PRECISION_CHARACTERISTICS96DEFAULT_TENSORRT_CONFIG96DEFAULT_TENSORRT_CALIBRATION_CONFIG96DEFAULT_ONNX_OPTIMIZATION_CONFIG96DEFAULT_MIXED_PRECISION_CONFIG96DEFAULT_OPERATOR_FUSION_CONFIG96DEFAULT_OPTIMIZATION_CONSTRAINTS96DEFAULT_UNIFIED_OPTIMIZATION_CONFIG96TensorRTCompiler111EntropyCalibrator111MinMaxCalibrator111PercentileCalibrator111createTensorRTCompiler111createCalibrator111 +46 moreComprehensive motion validation library with ground truth management, evaluation metrics, automated testing, and human evaluation frameworks
Validation and benchmarking infrastructure (libs/aja/motion-validation/src,
~14K LOC). It defines standard skeletons and ground-truth dataset management
(ground-truth.ts — Human3.6M / CMU / COCO), evaluation metrics (metrics.ts —
MPJPE/PA-MPJPE/N-MPJPE/PCK, velocity/acceleration/jerk, anatomical plausibility,
footskate), plus regression, stress, edge-case, and human-evaluation harnesses.
The deeper testing-rig counterpart to motion-quality's per-clip scoring.
CMU_MOCAP_SKELETON100COCO_SKELETON100createEmptyMotionSequence100createGroundTruthAnnotation100calculatePAMPJPE128calculateNMPJPE128calculatePCK128detectFootskate128calculateTemporalConsistency128createMetricConfig128createEvaluationSuite128PCKResult128TemporalMetricsResult128AnatomicalPlausibilityResult128 +89 moreMulti-view 3D reconstruction for human pose estimation
Multi-camera 3D reconstruction (libs/aja/multi-view-reconstruction/src). It
implements camera calibration (calibration.ts — intrinsics/extrinsics), 3D
triangulation from multiple views (triangulation.ts), view synchronization
(synchronization.ts — audio/visual/timecode), multi-view pose fusion
(fusion.ts), and volumetric capture (volumetric.ts — point clouds, TSDF,
mesh extraction). A real multi-view geometry stack on the capture side.
DEFAULT_CALIBRATION_CONFIG67DEFAULT_TRIANGULATION_CONFIG67DEFAULT_SYNC_CONFIG67DEFAULT_FUSION_CONFIG67DEFAULT_VOLUMETRIC_CONFIG67PatternDetector76IntrinsicCalibrator76ExtrinsicCalibrator76createPatternDetector76createIntrinsicCalibrator76createExtrinsicCalibrator76Triangulator86createTriangulator86createRealtimeTriangulator86 +22 moreMonocular 3D pose lifting library for converting 2D keypoints to 3D poses
Monocular 2D→3D pose lifting (libs/aja/pose-lifting/src). It implements
lifting networks (lifting-networks.ts —
VideoPose3D/PoseFormer/MixSTE/MotionBERT/ MHFormer architectures),
depth-estimation integration (depth-estimation.ts —
MiDaS/ZoeDepth/Depth-Anything), camera-intrinsics estimation
(camera-estimation.ts), bone-length optimization (bone-optimization.ts), and
anthropometric validation, fronted by a createPoseLiftingService orchestrator.
Real geometry and bone/anthropometric optimization; the learned lifting
backbones are the model seam the service drives.
DEFAULT_DEPTH_ESTIMATION_CONFIG76DEFAULT_PERSPECTIVE_CORRECTION_CONFIG76DEFAULT_BONE_OPTIMIZATION_CONFIG76COCO_SKELETON_TEMPLATE76VideoPose3DNetwork92PoseFormerNetwork92MixSTENetwork92MotionBERTNetwork92MHFormerNetwork92createLiftingNetwork92getRecommendedLiftingNetwork92LiftingNetwork92MiDaSDepthEstimator107ZoeDepthEstimator107 +39 moreProportional adaptation for motion retargeting with limb scaling, reach adjustment, ground contact, and collision avoidance
Proportional adaptation for retargeting between differently-proportioned
skeletons (libs/aja/proportional-adaptation/src). It implements limb-length
scaling (limb-scaling.ts), reach adjustment so a character can still reach
targets (reach-adjustment.ts), ground-contact adaptation to prevent foot
penetration/sliding (ground-contact.ts), and self-collision avoidance
(collision-avoidance.ts), composed by pipeline.ts /
runProportionalAdaptation. A real geometric adaptation stage in the
retargeting band.
DEFAULT_LIMB_SCALING_CONFIG93DEFAULT_REACH_ADJUSTMENT_CONFIG93DEFAULT_GROUND_CONTACT_CONFIG93DEFAULT_COLLISION_AVOIDANCE_CONFIG93DEFAULT_PROPORTIONAL_ADAPTATION_CONFIG93computeLimbScale105LimbScalingValidation105compareLimbLengths105LimbLengthComparison105IKSolution130FootSlidingMetrics146countSelfIntersections162SelfIntersectionStats162adaptMotion185Semantics-aware motion retargeting with action recognition and intent preservation
Semantics-aware retargeting that preserves motion intent
(libs/aja/semantic-retargeting/src). It performs action recognition
(action-recognition.ts — locomotion/manipulation/gesture/combat), semantic
feature extraction (semantic-features.ts — energy/tempo/spatial extent),
context-aware joint prioritization (joint-priorities.ts), intent preservation
with verification (intent-preservation.ts), and an extensible
rules-engine.ts, composed in pipeline.ts. It sits above geometric
retargeting to keep the meaning of a motion intact.
DEFAULT_SEMANTIC_CONFIG135DEFAULT_INTENT_TOLERANCES135JOINT_PRIORITY_WEIGHTS135DEFAULT_CATEGORY_PRIORITIES135recognizeActions146recognizeActionAtRange146getActionCategory146canTransition146DEFAULT_ACTION_OPTIONS146xtractSemanticFeatures158analyzeMotionStyle158compareSemanticFeatures158blendSemanticFeatures158DEFAULT_FEATURE_OPTIONS158 +27 moreVideo chunking for distributed motion pipeline processing
Video chunking for distributed processing (libs/aja/video-chunking/src). It
performs temporal splitting (video-splitter.ts), overlap handling for boundary
continuity (overlap-handler.ts), result merging (result-merger.ts), and
seamless reconstruction (reconstructor.ts) over chunk/time/frame-range types.
It is the scatter half of the distributed pipeline, paired with
result-aggregation on the gather side.
DEFAULT_CHUNKING_CONFIG50DEFAULT_BLENDING_CONFIG50DEFAULT_RECONSTRUCTION_CONFIG50VideoSplitter60createVideoSplitter60createVideoMetadata60validateChunks60OverlapHandler73createOverlapHandler73calculateOverlapFrames73rangesOverlap73getBlendWeight73ResultMerger87createResultMerger87 +16 moreConsent management for tracking user consent for data usage, uploads, and processing
Consent tracking for data usage, uploads, and processing
(libs/aja/consent-management/src). It provides a core ConsentManager with
InMemoryConsentStorage, plus specialized managers for upload consent
(upload-consent.ts), verification (consent-verification.ts, email/SMS), and
withdrawal (withdrawal-manager.ts), with audit logging and legal-basis
tracking in types.ts. The storage seam is pluggable; the in-memory
implementation is the default backing.
ConsentManager20InMemoryConsentStorage20createConsentManager20createInMemoryConsentStorage20GrantConsentOptions20DenyConsentOptions20ConsentStatistics20UploadConsentManager31createUploadConsentManager31UploadConsentOptions31UploadConsentStatistics31ConsentVerificationManager39createConsentVerificationManager39VerificationHook39 +5 moreUpload scanning and moderation workflow (libs/aja/content-moderation/src).
UploadScanner composes pluggable ContentDetectors — NsfwDetector,
ViolenceDetector, CopyrightDetector, PolicyViolationDetector — and
moderation-workflow.ts adds a ModerationQueue, AppealManager,
BanManager, and AutomatedModerator. The detector interface is the seam where
a real classifier would plug in; the workflow/queue/appeal/ban state machine
around it is fully implemented.
UploadScanner21NsfwDetector21ViolenceDetector21CopyrightDetector21PolicyViolationDetector21createUploadScanner21ContentDetector21ScanOptions21ModerationQueue33AppealManager33BanManager33AutomatedModerator33createModerationQueue33createAppealManager33 +9 moreData retention management including configurable policies, automatic deletion, user data export, and right to be forgotten
Data-retention management with GDPR-style compliance
(libs/aja/data-retention/src). It includes a RetentionPolicyManager with
conditions/actions and default policies, a DeletionManager with scheduling /
grace periods / legal holds (over an InMemoryRetentionStorage seam),
multi-format DataExportManager (JSON/CSV/XML), and a
right-to-be-forgotten.ts implementation (GDPR Article 17) that issues erasure
certificates. Compliance logic is real; persistence is a pluggable storage
interface.
RetentionPolicyManager20createRetentionPolicyManager20createRetentionPolicyManagerWithDefaults20createDefaultPolicies20DeletionManager28InMemoryRetentionStorage28createDeletionManager28createInMemoryRetentionStorage28DeletionStatistics28DataExportManager37createDataExportManager37DataExportStatistics37RightToBeForgottenManager44createRightToBeForgottenManager44 +4 moreVisual privacy protection including face anonymization for motion capture assets
Visual privacy protection for mocap assets (libs/aja/privacy-protection/src).
It provides face detection/tracking (face-detection.ts), multiple
anonymization techniques (face-anonymizer.ts — blur, pixelate, mask,
silhouette), identity-based selective anonymization (identity-manager.ts), and
policy management for consistent rules. The detection/identity stages are the
model seams; the anonymization transforms and policy logic are concrete.
FaceDetector18PersonDetector18DetectionTracker18createFaceDetector18createPersonDetector18createDetectionTracker18FaceAnonymizer28createBlurAnonymizer28createPixelateAnonymizer28createMaskAnonymizer28createBlackoutAnonymizer28createSilhouetteAnonymizer28IdentityManager38PolicyManager38 +4 moreComprehensive motion capture format conversion library supporting BVH, FBX, glTF, USD, Alembic, and more
Mocap format conversion (libs/aja/motion-formats/src; package
@aja/motion-formats) and a foundational dependency for the area. It provides
import/export for BVH (bvh.ts), FBX (fbx.ts), glTF/GLB (gltf.ts), USD
(usd.ts), and Alembic (alembic.ts), plus a searchable clip-database.ts, a
generic mocap-import.ts, and quality/validation helpers. Its AnimationClip /
MotionFormat types are consumed across the area (e.g. by film-pipeline).
BVHParser31BVHWriter31BVHImporter31BVHExporter31quaternionToEuler31ulerToQuaternion31createMultiTakeBVH31xportMultiTakeBVH31validateBVH31getBVHInfo31resampleBVH31rimBVH31concatenateBVH31MultiTakeBVH31 +54 moreMotion capture data cleanup, enhancement, and processing library
Mocap cleanup and enhancement (libs/aja/motion-processing/src; package
@aja/motion-processing). It implements noise reduction with real signal
processing (noise-reduction.ts — FFT/IFFT, power spectrum, dominant-frequency
analysis), foot-sliding correction (foot-sliding.ts), physics-based cleanup
(physics-cleanup.ts — CoM smoothing, balance validation), retiming
(retiming.ts), gap filling (gap-filling.ts), and segmentation
(segmentation.ts). A real DSP-grade cleanup stage between capture and
retargeting.
ifft25owerSpectrum25getDominantFrequency25analyzeSignal25WaveletDenoiser25AdaptiveMotionFilter25NoiseReductionOptions25gaussianSmooth25waveletDenoise25adaptiveFilter25VelocityContactDetector56VelocityContactOptions56FABRIKSolver56CCDSolver56 +41 moreComprehensive motion capture quality assessment and automated QA pipeline
Motion-quality assessment (libs/aja/motion-quality/src; package
@aja/motion-quality). ground-truth-comparison.ts implements real metrics —
MPJPE, PA-MPJPE (Procrustes-aligned), PCK, AUC with Euclidean joint distances —
alongside basic metrics (quality-metrics.ts: jitter, foot-sliding,
bone-length, joint angles), perceptual metrics (perceptual-metrics.ts), and an
automated QA pipeline (qa-pipeline.ts) that validates/rejects/reports. The
metrics compute against actual joint data, not placeholders.
DEFAULT_JOINT_ANGLE_LIMITS90DEFAULT_QUALITY_THRESHOLDS90DEFAULT_MAX_VELOCITIES90MPJPE_THRESHOLDS90PCK_THRESHOLDS90analyzeJitter102analyzeFootSliding102analyzeBoneLength102analyzeJointAngles102analyzeSmoothness102analyzePhysicalPlausibility102analyzeBasicQuality102JitterAnalysisConfig102FootSlidingAnalysisConfig102 +30 moreNeural motion retargeting (libs/aja/neural-retargeting/src; package
@aja/neural-retargeting). networks/ implements real TS tensor ops and layers
(layers.ts — Float32Array tensors, graph-conv weights) for Skeleton-Aware
Networks (san.ts), Neural Kinematic Networks (nkn.ts), a transformer
(transformer.ts), and AdaIN style transfer (style-transfer.ts).
inference.ts runs through an injectable ONNX Runtime seam and falls back
to linear-interpolation retargeting when no model is loaded — real network code
with an honest runtime boundary, not a fabricated result.
add131sub131scale131dot131cross131length131normalize131rotation6DToMatrix131arrayToRotation6D131rotation6DToArray131writeRotation6DToArray131quatFromAxisAngle131quatFromEuler131quatToEuler131 +93 moreOptimization-based inverse kinematics for motion retargeting
Optimization-based inverse kinematics for retargeting
(libs/aja/optimization-ik/src; package @aja/optimization-ik). It implements
a real solver suite under solvers/ — FABRIK, CCD, gradient descent, a
Jacobian-transpose/pseudo-inverse solver, and Levenberg-Marquardt — over a
shared jacobian.ts (world-transform computation), chain-builder.ts, joint
limits/DOF types, and a full-body.ts coordinator. Genuine numeric IK, not a
wrapper.
EPSILON84DEG_TO_RAD84RAD_TO_DEG84vec384quat84mat484jacobian84clamp84lerp84smoothstep84degToRad84radToDeg84normalizeAngle84shortestAngleDist84 +38 moreComprehensive skeleton templates, automatic matching, and retargeting mappings
Skeleton mapping and retargeting utilities (libs/aja/skeleton-mapping/src;
package @aja/skeleton-mapping). It ships skeleton templates for major formats
(templates.ts — Mixamo, MediaPipe, Unity, COCO, SMPL), automatic matching
algorithms (matching.ts — name/hierarchy/position/semantic), partial-skeleton
handling (partial.ts — upper/lower/hands/face presets), and a
topology-agnostic "primal skeleton" converter (converters.ts). The
foundational mapping layer the other retargeting libraries and bone-mapping-ui
build on.
DEFAULT_PROPORTIONS92DEFAULT_AUTO_MATCH_CONFIG92PRIMAL_BONE_LENGTHS92REGION_JOINTS92MEDIAPIPE_POSE_TEMPLATE103UNITY_HUMANOID_TEMPLATE103COCO_17_TEMPLATE103H36M_17_TEMPLATE103OPENPOSE_BODY25_TEMPLATE103SMPL_24_TEMPLATE103FITNESS_STANDARD_TEMPLATE103getSkeletonTemplate103getSkeletonTemplateByType103listSkeletonTemplates103 +38 moreinfra (2)#
Motion pipeline asset storage with tiered storage, CDN distribution, and automatic archival
Tiered motion-asset storage with CDN distribution and automatic archival
(libs/aja/asset-storage/src). MotionAssetManager (asset-manager.ts)
orchestrates tiered-storage.ts, cdn-distribution.ts, and
automatic-archival.ts, with declared STORAGE_TIERS, retention policies, and
signed-URL/cache configuration in types.ts. It is the infra-layer
(layer:infra) home for pipeline artifacts and their lifecycle transitions.
STORAGE_TIERS53DEFAULT_RETENTION_POLICIES53DEFAULT_CDN_CACHE53MotionAssetManager59createMotionAssetManager59CDNDistribution72createCDNDistribution72createCDNConfig72TieredStorageManager88createTieredStorageManager88ArchivalManager105createArchivalManager105Video encryption, key management, and access control for motion pipeline
At-rest and in-transit content security for mocap assets
(libs/aja/content-security/src), and a genuinely real crypto implementation:
encryption.ts uses Node's node:crypto with aes-256-gcm (real
createCipheriv / getAuthTag, AEAD), alongside AES-256-CBC and
ChaCha20-Poly1305. It adds envelope encryption / key management
(key-management.ts, with LocalKeyProvider + rotation), access control
(access-control.ts), transit security (transit-security.ts), and audit
logging. This is one of the most fully-real libraries in the area.
ContentEncryptor19createContentEncryptor19EncryptOptions19DecryptOptions19KeyManager27LocalKeyProvider27InMemoryKeyStore27createLocalKeyManager27KeyStore27KeyEncryptionProvider27KeyListFilter27GenerateKeyOptions27RotationResult27AccessControlManager40 +34 moreui (2)#
A React (.tsx) UI library (libs/aja/avatar-preview-ui/src) for previewing
and comparing avatars in the Lilith mocap system. It provides AvatarPreview,
ComparisonView (side-by-side variants), ABTestInterface, and
QualityOverlay components plus driving hooks (useAvatarPreview, useABTest,
useQualityOverlay). It is a layer:ui node — presentation/interaction over
the animation and quality data, not a processing stage.
DEFAULT_VIEWPORT_SETTINGS95DEFAULT_DISPLAY_SETTINGS95DEFAULT_QUALITY_OVERLAY_CONFIG95DEFAULT_QUALITY_THRESHOLDS95DEFAULT_AB_TEST_METRICS95useAvatarPreview109UseAvatarPreviewOptions109UseAvatarPreviewResult109useABTest115createABTestConfig115UseABTestOptions115UseABTestResult115useQualityOverlay122colorToRgba122 +9 moreInteractive bone mapping UI components for skeleton retargeting visualization and manipulation
A React UI library (libs/aja/bone-mapping-ui/src) for visually mapping
bones/joints between skeleton templates for retargeting. Components include
BoneMappingWorkspace, SkeletonViewer, JointMapperPanel,
MappingConnection, MotionPreview, and MappingProfileManager, backed by
hooks for drag-and-drop, mapping history/undo, profile persistence, and skeleton
visualization. It is the human-in-the-loop editor that produces the mappings the
skeleton-mapping library consumes.
DEFAULT_COLOR72DEFAULT_JOINT_STYLE72DEFAULT_BONE_STYLE72DEFAULT_MAPPING_CONNECTION_STYLE72DEFAULT_PLAYBACK_STATE72DEFAULT_MOTION_PREVIEW_CONFIG72DEFAULT_UI_SETTINGS72DEFAULT_DRAG_OPERATION72generateId72generateProfileId72generateConnectionId72generateHistoryEntryId72colorToRgba72colorToHex72 +41 moreunclassified (10)#
Comprehensive avatar library with pre-built instructors, customization, and marketplace support
The avatar/instructor catalog (libs/aja/avatar-library/src) with pre-built
instructors, customization, style categories, and a community-marketplace
surface. prebuilt/ holds real authored data — named yoga, fitness, and
meditation instructors (e.g. MAYA_VINYASA, MARCUS_HIIT) with full skeleton
joint hierarchies — exposed through registries and query helpers
(getInstructor, searchInstructors, getInstructorsByTier). categories/,
customization/, and marketplace/ add the catalog services around that data.
ALL_LIBRARY_AVATARS20INSTRUCTOR_REGISTRY20getInstructor20getLibraryAvatar20searchInstructors20getInstructorsByCategory20getInstructorsByTier20getFreeInstructors20getFeaturedInstructors20getRecentlyUpdatedInstructors20getInstructorStats20YOGA_INSTRUCTOR_REGISTRY20YOGA_STYLE_CATEGORIES20MAYA_VINYASA20 +57 moreDepth-sensor integration and RGB-D processing (libs/aja/depth-sensing/src).
sensor-driver.ts defines an abstract DepthSensorDriver base (state
machine, connect()/disconnect() abstract methods) describing RealSense /
Azure Kinect / Apple LiDAR — i.e. a driver abstraction, not a bundled native SDK
binding. The real processing lives in rgbd-fusion.ts (alignment/fusion),
mesh-recovery.ts (body mesh from depth), and depth-quality.ts (assessment /
enhancement).
DEFAULT_SENSOR_CONFIG58DEFAULT_RGBD_FUSION_CONFIG58DEFAULT_MESH_RECOVERY_CONFIG58DEFAULT_DEPTH_QUALITY_CONFIG58SENSOR_CAPABILITIES58DepthSensorDriver74SimulatedSensorDriver74DepthFrameProcessor74createSensorDriver74createDepthFrameProcessor74getSensorCapabilities74RGBDAligner84RGBDPointCloudGenerator84DepthColorizer84 +9 moreDistributed worker system for Kubernetes with auto-scaling, GPU node affinity, and fault tolerance
Distributed worker system targeting Kubernetes with autoscaling, GPU node
affinity, and fault tolerance (libs/aja/distributed-workers/src). The
autoscaler (autoscaler.ts) and fault-tolerance.ts logic are real, but the
KubernetesClient in kubernetes.ts simulates the API calls (in-source:
"For simulation, we just mark as initialized", "Simulate job creation") rather
than binding a live cluster API. Honest framing: a real scheduling/scaling
control plane over a simulated K8s client seam.
DEFAULT_RESOURCE_REQUIREMENTS146DEFAULT_WORKER_CONFIG146DEFAULT_JOB_CONFIG146DEFAULT_AUTOSCALING_POLICY146DEFAULT_FAULT_TOLERANCE_CONFIG146DEFAULT_K8S_CLIENT_CONFIG160createGPUWorkerConfig160buildGPUNodeAffinity160getGPUTolerations160MetricsCollector182PredictiveScaler182createMetricsCollector182createPredictiveScaler182calculateScalingEfficiency182 +9 moreCross-domain integration adapters for Lilith motion pipeline with Yemaya, Isis, Bellona, and Sophia
Cross-domain integration adapters (libs/aja/motion-integration/src) that push
motion-pipeline outputs into sibling domains. It carries dedicated adapter +
types modules for Yemaya (Creative Studio asset/project/folder mapping),
Isis, Bellona, and Sophia, over a shared set of branded IDs
(MotionAssetId, MotionJobId, …) and base adapter/auth/retry config in
types.ts. This is the outbound boundary layer for the pipeline.
TypeScript SDK for Lilith Motion Pipeline Service
The typed TypeScript SDK (libs/aja/motion-pipeline-sdk/src) for the Lilith
Motion Pipeline Service. client.ts exposes a MotionPipelineClient with a
fluent job builder, config management, SSE progress streaming, download-URL
generation, and webhook management, with typed errors in errors.ts. It is the
external entry point consumers use instead of hand-rolling HTTP against the
service.
MotionPipelineClient56ConfigBuilder56JobBuilder56jobId66configId66deliveryId66DEFAULT_SDK_CONFIG71SDKErrorCodes137isSuccess142isError142unwrap142SDKError148ConfigurationError148ValidationError148 +27 morePipeline parallelism system with stage overlapping, async execution, memory pipelining, and multi-GPU distribution
A general pipeline-parallelism engine (libs/aja/pipeline-parallelism/src) for
high-throughput inference/data processing. It supports stage overlapping and
async stage execution via queues (async-queue.ts, stage.ts), memory
pipelining with pooling/GC (memory-pipeline.ts), and multi-GPU stage
distribution (multi-gpu.ts), assembled through a createPipeline builder and
scheduler.ts. It is the stage-overlap counterpart to batch-inference's
batching.
DEFAULT_STAGE_CONFIG140DEFAULT_PIPELINE_CONFIG140createStageWithExecutor146createBatchStage146createPipelineItems146calculateStageEfficiency146calculateStageHealth146createQueueManager174drainQueue174monitorQueueDepth174createMemoryPipelineManager197createDefaultMemoryConfig197calculateStageMemoryDistribution197isMemoryCritical197 +9 moreResult aggregation system with distributed collection, conflict resolution, quality selection, and final assembly
Result aggregation for distributed processing
(libs/aja/result-aggregation/src). A result-collector.ts gathers per-chunk
worker results, conflict-resolver.ts reconciles overlapping/disagreeing
outputs, quality-selector.ts picks the best candidate, and
final-assembler.ts stitches the final artifact. It is the gather/merge
counterpart to video-chunking's scatter, closing the distributed loop.
DEFAULT_COLLECTION_CONFIG115DEFAULT_CONFLICT_RESOLUTION_CONFIG115DEFAULT_QUALITY_WEIGHTS115DEFAULT_QUALITY_SELECTION_CONFIG115DEFAULT_ASSEMBLY_CONFIG115DEFAULT_AGGREGATION_PIPELINE_CONFIG115ResultBuffer128createResultBuffer128computeChecksum128verifyChecksum128calculateCollectionProgress128meetsQuorum128countConflictsByType149getHighestSeverityConflict149 +9 moreContent watermarking for motion capture assets - invisible video watermarks, motion data watermarks, provenance tracking, and leak detection
Watermarking and provenance for mocap assets
(libs/aja/content-watermarking/src). It implements DCT-based spread-spectrum
video watermarking (video-watermark.ts, 8×8 blocks with a generated
spread-spectrum key — note the mid-frequency DCT coefficient edit is
approximated via pixel modification, labelled in-source), LSB motion-data
watermarking in joint positions (motion-watermark.ts), a blockchain-like
ProvenanceManager (provenance.ts), and a LeakDetectionService
(leak-detection.ts). Real spread-spectrum/LSB scheme with a documented
coefficient-level approximation.
VideoWatermarker17createVideoWatermarker17MotionWatermarker20createMotionWatermarker20JointData20SkeletonFrame20MotionSequence20ProvenanceManager29createProvenanceManager29LeakDetectionService32createLeakDetectionService32WatermarkRecord32ScanOptions32AlertFilter32Intermediate caching for motion processing pipelines
Intermediate-result caching for motion pipelines
(libs/aja/pipeline-cache/src). A pipeline-cache-manager.ts coordinates
stage-specific caches — pose-estimation-cache.ts, lifting-cache.ts,
retargeting-cache.ts — keyed by a structured PipelineCacheKey, with
cache-invalidation.ts and cache-utils.ts handling key derivation and
eviction. It lets the expensive stages skip recomputation across pipeline runs.
CacheEntryStatus9PipelineCacheKey9CacheKeyString9CacheEntry9CachedPose2D9CachedPoseEstimation9CachedPoseSequence9CachedPose3D9CachedCameraIntrinsics9CachedDepthMap9CachedBoneLengths9CachedLiftingResult9CachedLiftingSequence9Vec39 +74 moreHuman mesh recovery library for motion capture - SMPL/SMPL-X body model fitting
Human mesh recovery (libs/aja/human-mesh-recovery/src; package
@aja/human-mesh-recovery) targeting SMPL/SMPL-X. It implements real
SMPL/SMPL-X body math (smplx-body.ts), body fitting/optimization
(body-fitting.ts), mesh-to-skeleton conversion (mesh-skeleton.ts), and
temporal consistency (temporal-consistency.ts). The HMR2/CLIFF/PyMAF-X neural
backbone and person detection in smpl-recovery.ts are explicitly
simulated (in-source: "(simulated neural network)", "In production, this would
use YOLO …"), with model parameters defaulted rather than loaded — honest seams
around a real body-model core.
SMPL_JOINTS67SMPLX_ADDITIONAL_JOINTS67HMR_METHOD_CAPABILITIES67DEFAULT_HMR_CONFIG67DEFAULT_TEMPORAL_CONFIG67DEFAULT_FITTING_CONFIG67getSMPLJointCount67getSMPLVertexCount67getSMPLFaceCount67SMPLModel80HMRMethodBase80HMR2Method80CLIFFMethod80PyMAFXMethod80 +51 more