From d6b36154214161c02145c210b47c49891e6bc166 Mon Sep 17 00:00:00 2001 From: CrossProduct Date: Wed, 22 Jan 2025 22:07:52 +0000 Subject: [PATCH] Ok adapter trains need to get the pass for validation using a skeleton. --- finetrainers/trainer.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/finetrainers/trainer.py b/finetrainers/trainer.py index 3e2c259..c4267c3 100644 --- a/finetrainers/trainer.py +++ b/finetrainers/trainer.py @@ -825,15 +825,8 @@ class Trainer: width=latent_conditions["width"], patch_size = 1, patch_size_t = 1) - # target - latent_conditions["latents"] = post_conditioned_latent_patchify( - latents=latent_conditions["latents"], - num_frames=latent_conditions["num_frames"], - height=latent_conditions["height"], - width=latent_conditions["width"], - patch_size = 1, - patch_size_t = 1 - ) + # target latent patchified + # pose information latent latent_conditions.update({"noisy_latents": latent_final["latents"]}) latent_conditions.update({"noisy_latents_residual":noisy_latents_residual["latents"]}) @@ -875,6 +868,15 @@ class Trainer: scheduler=self.scheduler, noise=noise, latents=latent_conditions["latents"] ) + if self.pose_condition: + # patchify target + target = post_conditioned_latent_patchify(latents=target, + num_frames=latent_conditions["num_frames"], + height=latent_conditions["height"], + width=latent_conditions["width"], + patch_size = 1, + patch_size_t = 1)["latents"] + loss = weights.float() * (pred["latents"].float() - target.float()).pow(2) # Average loss across all but batch dimension loss = loss.mean(list(range(1, loss.ndim)))