Abstract
Recent advancements in image generation have achieved remarkable visual fidelity, yet models often struggle with the functional logic of human-scene interaction, known as affordances. This paper presents a generative framework designed to realistically insert people into scenes by automatically inferring the actions an environment allows. By employing a Latent Diffusion Model (LDM) trained on 2.4 million video clips, the system learns to re-pose reference individuals to fit specific contexts—such as sitting on a bench or playing an instrument—while simultaneously handling lighting harmonization and shadow generation in a single end-to-end step.
Introduction
In computer vision, "affordances" refer to the functional properties of an environment—the actions an agent can perform within a space. While modern AI can generate high-quality imagery, it frequently fails to respect the subtle geometric and logical constraints of human-scene interaction. Standard image editing tools often produce "floating" subjects or individuals standing in physically impossible locations, such as on top of coffee tables.
Existing solutions typically rely on complex 3D modeling or labor-intensive manual pose annotations, which are difficult to scale. This research addresses the challenge of affordance-aware human insertion: given a target scene with a masked area and a reference photo of a person, the model must determine a plausible pose, adjust the subject's body to that pose, and blend them into the environment with physical realism.
Methodology
The researchers frame human insertion as a conditional inpainting task using a Latent Diffusion Model (LDM). The core innovation lies in a self-supervised training strategy that utilizes the temporal consistency of video to learn affordances without manual labels.
Self-Supervised Video Training
The model is trained using a "two-frame" strategy:
- Frame Selection: Two random frames are sampled from a video clip of a moving person.
- Task Setup: The person in Frame A (the target scene) is masked out. The person in Frame B is cropped to serve as the reference subject.
- Learning Objective: The model is tasked with filling the mask in Frame A using the identity and clothing from Frame B. Because the subject is in a different pose in Frame B, the model must learn to re-pose the individual to fit the specific geometric context of Frame A.
Conditioning and Guidance
The model receives the masked scene and the mask itself as latent features. The reference person is injected into the generation process via cross-attention using CLIP ViT-L/14 embeddings. During inference, Classifier-Free Guidance (CFG) is employed to balance diversity (exploring different possible poses) with fidelity to the conditioning images.
Datasets and Scale
The model was trained on a massive scale to ensure robustness:
- 2.4 Million Video Clips: Filtered from an initial pool of 12 million videos to ensure high-quality human movement and clear keypoints.
- Humans in Context (HiC): The preprocessing pipeline followed the HiC dataset standards to focus on meaningful human-scene interactions.
- Validation: A held-out set of 50,000 videos was used for quantitative evaluation.
Key Insights
- Video as a Teacher: Video provides a "free" supervision signal. Since the same person appears in multiple poses within the same environment, the model learns the relationship between scene geometry and supported human poses implicitly.
- Implicit Harmonization: Unlike traditional pipelines that separate posing from blending, this diffusion-based approach handles re-posing, clothing adjustment, lighting, and shadow generation simultaneously.
- Multimodal Flexibility: By randomly dropping conditioning signals during training, the model can perform various tasks, including hallucinating a random person into a scene, generating a scene around a person, or performing partial body completion.
Results
Quantitative evaluations using metrics such as FID (realism) and PCKh (pose accuracy) demonstrate that the video-trained model significantly outperforms image-only baselines. Specifically, training on video improved pose accuracy (PCKh) from approximately 10.6 to 15.8 compared to models trained only on static images.
Qualitatively, the model excels at placing people in complex scenarios—such as sitting on tractors or leaning against walls—where general-purpose models like Stable Diffusion or DALL-E 2 often produce mismatched poses that ignore furniture or floor levels. Initializing the model with pre-trained Stable Diffusion weights and utilizing a larger UNet (860M parameters) further enhanced the quality of facial features and textures.
Limitations and Future Work
Despite its success, the model faces several challenges:
- Fine Detail: The VAE bottleneck can lead to artifacts in faces and extremities (e.g., the "six-fingered hand" problem).
- Pose Forcing: If a reference person is in a highly unusual pose, the model occasionally attempts to force that pose into the scene rather than adapting it naturally.
- Object Interaction: The model sometimes struggles with objects held by the reference person, such as guitars, occasionally merging them into the scene context incorrectly.
Future research aims to integrate explicit 3D awareness and physical constraints to further refine the realism of human-object interactions.
Summary updated