Synthesizing Environment-Specific People in Photographs

Mirela Ostrek, Carol O'Sullivan, Michael J. Black, Justus Thies

Abstract

We present ESP (Environment-Specific People), a novel generative pipeline designed to automatically synthesize human figures into photographs with attire that semantically matches the surrounding environment. Traditional generative models often lack "contextual common sense," requiring manual text prompts to avoid incongruous results, such as placing a person in a swimsuit within a snowy landscape. ESP addresses this by extracting visual cues directly from the background to guide the generation process. Our three-stage framework utilizes a Variational Auto-Encoder (VAE) for context embedding, a StyleGAN-II for generating Human Parsing Maps (HPMs), and a Diffusion-based module for high-resolution inpainting. Experimental results demonstrate that ESP produces realistic, context-aware humans that outperform state-of-the-art baselines in both quantitative metrics and user preference studies.

Introduction

While modern artificial intelligence has achieved remarkable success in generating high-fidelity images of humans, a significant challenge remains in achieving contextual consistency. Most existing models struggle to understand the relationship between a person's clothing and their environment without explicit guidance. For instance, a model asked to place a person on a football pitch might generate a generic outfit rather than a sports jersey unless specifically prompted.

Existing solutions generally fall into two categories: GAN-based models trained on studio photography, which lack environmental variety, or Diffusion-based models that depend heavily on precise, manual text descriptions. ESP bridges this gap by introducing an automated, image-based system that understands environmental logic—recognizing that a forest requires hiking gear and a track requires athletic wear—while maintaining the original photo's lighting and aesthetic.

Methods: The ESP Pipeline

The ESP framework is structured as a three-stage pipeline that separates the "planning" of a human figure from the final "painting" of pixels.

The three-stage ESP architecture: Context Encoding, Context-Aware HPM Generation, and Appearance Synthesis.

1. Context Encoding

The system first processes the input background image using a Variational Auto-Encoder (VAE). This encoder compresses the environment into a "context embedding," capturing global features such as the color palette, lighting conditions, and general scene type (e.g., indoor vs. outdoor, urban vs. natural).

2. Contextual HPM Generation

This stage represents the core innovation of the paper. A StyleGAN-II generator is conditioned on two inputs: a target 2D pose and a "contextual style vector" (a combination of the VAE embedding and random noise). Instead of generating a final RGB image, the model produces a Human Parsing Map (HPM). This semantic map labels specific body parts and clothing items, allowing the model to logically plan an outfit based on the context before any textures are applied.

3. Inpainting and Super-Resolution

The generated HPM is then passed to a pre-trained Stable Diffusion model via a ControlNet module. This final stage performs the heavy lifting of translating the semantic map into photo-realistic pixels. By using the HPM as a guide, the diffusion model ensures the synthesized person blends seamlessly into the background while adhering to the planned attire and geometry.

Datasets and Training

The models were trained on a refined version of the Annotated Human Parsing (AHP) dataset. While the original dataset contains 56,000 "in-the-wild" images, the authors filtered this to approximately 23,000 high-quality samples. Unlike datasets like DeepFashion, which feature studio shots with plain backgrounds, AHP provides the necessary diversity of real-world environments. This allows the model to learn the crucial link between a person's surroundings and their appropriate clothing.

Key Results and Evaluation

ESP was evaluated against several state-of-the-art baselines, including StyleGAN-Human and TextHuman.

Qualitative samples from the ESP pipeline showing diverse, context-appropriate clothing generated for various environments and poses.

Quantitative Performance

Quantitatively, ESP achieved significantly lower Fréchet Inception Distance (FID) and Kernel Inception Distance (KID) scores compared to its competitors. These metrics indicate that the images generated by ESP are more realistic and better match the distribution of real-world photographs.

Qualitative Realism and Context Awareness

Qualitatively, the system demonstrates a high degree of context awareness. For example, when a person is placed in a sunset scene, the model generates warmer skin tones and specific highlights that match the golden-hour lighting. Furthermore, the use of a random noise vector in the HPM generation stage allows for stochasticity; the model can generate multiple valid outfits (e.g., different colored jerseys) for the same environment.

User Preference

In a perceptual study, human evaluators preferred the results produced by ESP 62% of the time over other leading methods, citing better integration with the background and more logical clothing choices.

Limitations and Future Work

Despite its success, the authors identify several areas for improvement. The model is currently optimized for relatively simple, upright poses and may struggle with extreme athletic or complex positions. Additionally, the system inherits biases from the AHP dataset, such as a lack of racial diversity in certain contexts and a gender imbalance. Future work will focus on diversifying the training data to mitigate these demographic biases and expanding the model's capability to handle more complex human-environment interactions.

Summary updated

BibTeX
@inproceedings{ostrek2024synthesizing,
  author = {Mirela Ostrek and Carol O'Sullivan and Michael J. Black and Justus Thies},
  title = {{Synthesizing Environment-Specific People in Photographs}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73013-9\_17},
}
Figure