(self, caption, m_lens, dim_pose)
| 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) |
no test coverage detected