INNER CODE UNIT · Python

times

jdh-algo/JoyHallo · scripts/app.py:345

    times = audio_emb.shape[0] // clip_length
    tensor_result = []
    # generator = torch.manual_seed(42)
    generator = torch.cuda.manual_seed_all(42) # use cuda random seed
    for t in range(times):
        print(f"[{t+1}/{times}]")

        if len(tensor_result) == 0:
            # The first iteration
            motion_zeros = source_image_pixels.repeat(
                cfg.data.n_motion_frames, 1, 1, 1)
            motion_zeros = motion_zeros.to(
                dtype=source_image_pixels.dtype, device=source_image_pixels.device)
            pixel_values_ref_img = torch.cat(
                [source_image_pixels, motion_zeros], dim=0)  # concat the ref image and the first motion frames
        else:
            motion_frames = tensor_result[-1][0]
            motion_frames = motion_frames.permute(1, 0, 2, 3)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…