Skip to content

API Reference

Everything public is importable from the top-level namespace (import pybvh_ml) — see pybvh_ml.__all__. The PyTorch layer lives in pybvh_ml.torch and imports only if torch is installed. The pages in this section group the reference by module.

Find a function

The fastest route from "I want to…" to the exact call.

I want to… Call Reference
Preprocess a BVH directory to one dataset file preprocess_directory("data/", "train.npz") Preprocessing
Load a preprocessed dataset load_preprocessed("train.npz") Preprocessing
Reconcile mixed skeletons / fps / up-axes preprocess_directory(..., harmonize=True) Preprocessing guide
Resample a corpus to a training frame rate preprocess_directory(..., target_fps=30) Preprocessing guide
Compute / apply z-score normalization compute_normalization_stats(bvhs), normalize_array(x, stats) Preprocessing
Pack arrays into a model layout pack_to_ctv(root_pos, jd), pack_to_tvc(...), pack_to_flat(...) Packing
Unpack a model layout back to arrays unpack_from_ctv(x), unpack_from_tvc(x), unpack_from_flat(x) Packing
Hold one clip's arrays MotionArrays(root_pos=…, joint_rot=…) Motion Arrays
Rotate a clip around the up axis rotate_vertical(arrays, angle=…, up_axis=…) Augmentation
Mirror a clip left/right mirror(arrays, lr_joint_pairs=…, lateral_axis=…) Augmentation
Perturb speed / drop frames / add noise speed_perturbation_arrays(...), dropout_arrays(...), add_joint_rotation_noise(...), add_root_position_noise(...) Augmentation
Compose augmentations with probabilities AugmentationPipeline([...]) / AugmentationPipeline.standard(skel) Pipeline
Convert a clip's rotation representation convert_arrays(arrays, "euler", "6d", euler_orders=…) Conversion
Convert a bare rotation array (no root stream) convert_rotations(jd, "euler", "6d", euler_orders=…) Conversion
Get graph edges / L/R pairs / body parts get_edge_list(bvh), get_lr_pairs(bvh), get_body_partitions(bvh) Skeleton
Get all skeleton metadata at once get_skeleton_info(bvh) Skeleton
Cut sliding windows sliding_window(data, window_size=64, stride=32) Sequences
Pad / crop to a fixed length standardize_length(data, target_length=128) Sequences
Sample frames PySKL-style sample_temporal(data, clip_length=64, mode="train") Sequences
Know what each packed column means describe_features(num_joints=24, representation="6d") Metadata
Build a PyTorch Dataset from a preprocessed file MotionDataset.from_preprocessed(loaded) PyTorch
Build a PyTorch Dataset from clip dicts MotionDataset(clips, target_length=128) PyTorch
Build a Dataset straight from BVH paths OnTheFlyDataset(paths, representation="6d") PyTorch
Feed a GCN fixed-budget (C, T, V) clips MotionDataset(..., layout="ctv", temporal="resample") PyTorch guide
Batch variable-length clips with masks DataLoader(ds, collate_fn=collate_motion_batch) PyTorch
Seed your own Dataset the same way rng_for(seed, epoch, idx), EpochState() PyTorch guide

Modules at a glance

Module Owns Page
pybvh_ml.packing (C, T, V) / (T, V, C) / flat (T, D) layout conversion, both directions Packing
pybvh_ml.augmentation the five array-level augmentation functions Augmentation
pybvh_ml.pipeline AugmentationPipeline — composition, probabilities, quat caching Pipeline
pybvh_ml.preprocessing directory → dataset file, harmonization, normalization stats Preprocessing
pybvh_ml.sequences sliding windows, length standardization, temporal sampling Sequences
pybvh_ml.skeleton graph metadata: edges, L/R pairs, partitions, skeleton_info Skeleton
pybvh_ml.convert convert_arrays (a whole clip) / convert_rotations (a bare (F, J, C) array) — representation conversion Conversion
pybvh_ml.metadata FeatureDescriptor / describe_features column maps Metadata
pybvh_ml.torch optional: Dataset classes and the collate function PyTorch