Putting People in Their Place: Affordance-Aware Human Insertion into Scenes

Sumith Kulal, Tim Brooks, Alex Aiken, Jiajun Wu, Jimei Yang, Jingwan Lu, Alexei A. Efros, Krishna Kumar Singh

TL;DR

Researchers have developed a self-supervised method to realistically insert people into images by teaching a diffusion model to understand "affordances"—the physical actions a scene allows. By training on 2.4 million video clips, the model learns to automatically re-pose and harmonize a reference person to fit naturally into a new environment, such as making them sit on a chair or ride a horse.

What Problem Does This Paper Address?

In computer vision, "affordance" refers to the functional properties of a scene—what an agent can actually do in it. While humans intuitively know you can sit on a chair but not on a vertical wall, teaching this to AI is difficult.

Existing methods for inserting objects or people into scenes often fail because they lack this contextual understanding. They might place a person in a physically impossible pose or fail to account for how a person’s body must deform to interact with the environment (e.g., bending knees to sit). Previous attempts to solve this relied on complex 3D modeling or small, specialized datasets. This paper seeks a general, data-driven way to learn these interactions directly from the vast amount of human activity captured in video.

Methods

The authors frame human insertion as a conditional inpainting task using a Latent Diffusion Model (LDM).

  1. Self-Supervised Training: The core innovation is using video for supervision. The model takes two random frames from a video clip. It masks out the person in the first frame (the "target scene") and uses the person from the second frame as the "reference person." The model must then "inpaint" the person back into the first frame. Because the person's pose changes between frames, the model is forced to learn how to re-pose the human to match the target scene's context.
  2. Architecture: The system uses a U-Net denoiser conditioned on two inputs:
  3. The masked scene and the mask itself (concatenated with the noisy latent).
  4. The reference person, encoded via a CLIP ViT-L/14 image encoder and injected into the U-Net via cross-attention layers.
  5. Masking & Augmentation: To make the model robust, the authors use a variety of mask shapes (bounding boxes, segmentation masks, and scribbles) as shown in Figure 4. They also apply heavy color and geometric augmentations to the reference person (Figure 5) to ensure the model learns pose and appearance rather than just copying pixels.
Figure 2. Architecture overview. We source two random frames from a video clip. We mask out the person in the first frame and use the person from the second frame as conditioning to inpaint the image. We concatenate the latent features of the background image and rescaled mask along with the noisy image to the denoising UNet. Reference person embeddings (CLIP ViT-L/14) are passed via cross-attention.

Datasets

The model was trained on a massive dataset of 2.4 million video clips showing humans moving in diverse scenes. This was filtered down from an initial pool of 12 million videos using keypoint detectors (OpenPose) to ensure high-quality human motion was present. A validation set of 50,000 videos was held out for evaluation.

Key Insights and Ideas

  • Video as a Natural Teacher: Unlike static images, video provides a "free" training signal for affordances. It shows the same person in multiple poses within the same environment, providing the ground truth for how a body interacts with specific scene geometry.
  • Implicit Affordance: The model doesn't need explicit 3D maps or semantic labels. By observing millions of interactions, it implicitly learns that a flat horizontal surface at knee height "affords" sitting.
  • Flexibility through Conditioning: By randomly dropping conditioning signals during training (Classifier-Free Guidance), the model becomes versatile. It can insert a specific person, hallucinate a random person into a scene, or even hallucinate a scene around a person.

Key Results

The authors compared their model against baselines like Stable Diffusion and DALL-E 2, as well as versions of their own model trained only on static images.

  • Quantitative: The video-trained model achieved a significantly better FID (10.078) and PCKh (17.602) compared to image-only models (FID ~13.0). This confirms that video data is crucial for learning realistic positioning and re-posing.
  • Qualitative: As seen in Figure 6, the model successfully re-poses the same reference person to fit wildly different contexts—from riding a bike to playing a piano—while maintaining consistent appearance and realistic lighting/shadows.
Figure 6. Qualitative results of conditional generation. In the top 4 rows, we show a reference person in the first column, followed by four pairs of masked scene image and corresponding result. In the bottom 4 rows, we show a masked scene image in the first column, followed by four pairs of reference person and corresponding result. Our results have the reference person re-posed correctly according to the scene.

Limitations and Future Work

  • Fine Details: Like many diffusion models, it struggles with "bad faces and limbs," a limitation inherited from the underlying VAE (Variational Autoencoder) used for latent compression.
  • Lighting Mismatches: If the lighting in the reference person's image is drastically different from the target scene, the harmonization can sometimes fail.
  • Object Artifacts: If a reference person is holding an object (like a tennis racket), the model occasionally tries to "bleed" that object into the new scene, creating artifacts.
  • Future Directions: The authors suggest that training pixel-based diffusion models (rather than latent-based) or improving VAE encoders specifically for humans could resolve the detail issues.

Summary updated

BibTeX
@inproceedings{kulal2023putting,
  author = {Sumith Kulal and Tim Brooks and Alex Aiken and Jiajun Wu and Jimei Yang and Jingwan Lu and Alexei A. Efros and Krishna Kumar Singh},
  title = {{Putting People in Their Place: Affordance-Aware Human Insertion into Scenes}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  url = {https://openreview.net/forum?id=McRJXd2try},
}
Figure