INNER CODE UNIT · Python

generated_frames

Tencent-Hunyuan/HunyuanPortrait · gradio_app.py:341

    generated_frames = (generated_frames * 255).astype(np.uint8)
    
    final_frames = []
    x1, y1, x2, y2 = crop_bbox
    soft_mask = create_soft_mask((x2 - x1, y2 - y1))
    
    for i in range(len(generated_frames)):
        gen_frame = generated_frames[i]
        full_frame = paste_back_frame(original_image, gen_frame, crop_bbox, soft_mask)
        final_frames.append(Image.fromarray(full_frame))

    print(f"Saving videos to {job_dir} with FPS {fps}")
    save_videos_grid(video, save_video_path_crop, n_rows=1, fps=fps)
    save_videos_from_pil(final_frames, save_video_path_full, fps=fps)
    
    return save_video_path_crop, save_video_path_full

# --- 4. Gradio Interface ---

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…