MCPcopy Create free account
hub / github.com/MotrixLab/MotionDiffuse / generate_batch

Method generate_batch

text2motion/trainers/ddpm_trainer.py:91–106  ·  view source on GitHub ↗
(self, caption, m_lens, dim_pose)

Source from the content-addressed store, hash-verified

89 self.src_mask = self.encoder.generate_src_mask(T, cur_len).to(x_start.device)
90
91 def generate_batch(self, caption, m_lens, dim_pose):
92 xf_proj, xf_out = self.encoder.encode_text(caption, self.device)
93
94 B = len(caption)
95 T = min(m_lens.max(), self.encoder.num_frames)
96 output = self.diffusion.p_sample_loop(
97 self.encoder,
98 (B, T, dim_pose),
99 clip_denoised=False,
100 progress=True,
101 model_kwargs={
102 'xf_proj': xf_proj,
103 'xf_out': xf_out,
104 'length': m_lens
105 })
106 return output
107
108 def generate(self, caption, m_lens, dim_pose, batch_size=1024):
109 N = len(caption)

Callers 1

generateMethod · 0.95

Calls 2

encode_textMethod · 0.80
p_sample_loopMethod · 0.80

Tested by

no test coverage detected