[SIGGRAPH Asia 2026] UniMate: One Unified Model to Animate Diverse Skeletons
Python
Let num_epochs set the training budget even when num_steps is filled in; label generic bookkeeping bones such as extra_NN as Bone
Friedrich-Me62864e4201c
diff --git a/data_process/joint_annotation/names_clean_rule.py b/data_process/joint_annotation/names_clean_rule.pyindex 5a4e222..52c111e 100644--- a/data_process/joint_annotation/names_clean_rule.py+++ b/data_process/joint_annotation/names_clean_rule.py@@ -567,6 +567,10 @@ def _name_side(raw):return side or extract_inner_side(bare)[0]+# Bookkeeping names that say nothing about the body part: a placeholder.+_GENERIC_NAMES = frozenset({'extra', 'helper', 'dummy', 'null', 'joint', 'node', 'bone'})++def clean_joint_name(raw, animal, refine=True):"""Clean one joint name: the rules below, then (*refine*) the labelrefinements the reviewed annotations support:@@ -584,6 +588,9 @@ def clean_joint_name(raw, animal, refine=True):if not refine or not raw or not raw.strip():return outcleaned = post_process(out)+ side_m = re.match(r'^(Left|Right) ', cleaned)+ if re.sub(r'^(Left|Right) ', '', cleaned).lower() in _GENERIC_NAMES:+ out = cleaned = with_side(side_m.group(1) if side_m else None, 'Bone')if cleaned == 'Bone' or not is_canonical_label(cleaned):vocab = _learned_vocab()label = next((vocab[k] for k in name_keys(raw) if k in vocab), None)diff --git a/unimate/configs/schema.py b/unimate/configs/schema.pyindex c656d25..0597da6 100644--- a/unimate/configs/schema.py+++ b/unimate/configs/schema.py@@ -331,7 +331,7 @@ class TrainingConfig:min_lr_ratio: float = 0.01 # Min LR as a fraction of learning_rate# Duration- num_epochs: Optional[int] = None+ num_epochs: Optional[int] = None # when set, the budget (num_steps is then ignored)num_steps: Optional[int] = 100_000log_interval: int = 50save_interval: int = 10_000diff --git a/unimate/training/train.py b/unimate/training/train.pyindex 64d11bf..ef7e3c2 100644--- a/unimate/training/train.py+++ b/unimate/training/train.py@@ -157,9 +157,14 @@ def train_diffusion(args: TrainingArgs, config: MainConfig,# ---- Training tracker ----# Optimizer steps per epoch: this rank's batches over the accumulation# (accelerate also steps on an epoch's last, partial group).+ # An epoch budget wins over num_steps, which the schema always fills in.+ epoch_budget = bool(config.training.num_epochs)+ if epoch_budget and config.training.num_steps and is_main:+ logger.info(f"num_epochs={config.training.num_epochs} sets the budget; "+ f"num_steps={config.training.num_steps} is ignored.")tracker = TrainingTracker(- max_epochs=config.training.num_epochs,- max_steps=config.training.num_steps,+ max_epochs=config.training.num_epochs if epoch_budget else None,+ max_steps=None if epoch_budget else config.training.num_steps,steps_per_epoch=math.ceil(len(dataloader) / config.training.gradient_accumulation_steps),)