Introduction
Editing the appearance of head portraits—specifically relighting and camera viewpoint adjustment—remains a significant challenge in computer vision. The primary difficulty lies in the human sensitivity to facial inconsistencies, often referred to as the "uncanny valley." Existing methods typically struggle to balance physical accuracy with the ability to generalize to "in-the-wild" photographs. Supervised methods using specialized "light-stage" data often fail to capture hair and backgrounds effectively, while generative models like StyleGAN offer realism but lack precise control over physical parameters like lighting.
Methodology: The PhotoAppNet Framework
PhotoApp addresses these challenges by operating within the latent space of a pretrained StyleGAN2 model. The core component, PhotoAppNet, is a small MLP-based architecture designed to predict latent space displacements.
The process involves three main stages:
- Encoding: An input image is mapped to a StyleGAN latent code ($w \in \mathbb{R}^{18 \times 512}$) using a pretrained encoder (pSpNet).
- Transformation: PhotoAppNet takes the latent code, a target illumination (a 450D environment map vector), and a target camera pose (Euler angles) to predict a displacement ($\Delta w$).
- Synthesis: The modified code ($w + \Delta w$) is processed by the fixed StyleGAN2 generator to produce the final edited image.
By leveraging the StyleGAN latent prior, the model inherits sophisticated representations of complex features like hair and eyes, while supervised training on light-stage data teaches the network the underlying physics of light and perspective.
Experimental Setup
The model was trained using a light-stage dataset featuring 341 identities, each captured under 150 one-light-at-a-time (OLAT) conditions across 8 camera viewpoints. Realistic lighting was simulated using HDR environment maps from the Laval Outdoor and Naval Indoor datasets. Evaluation was performed on diverse "in-the-wild" datasets, including FFHQ, to test generalization beyond laboratory settings.
Results and Key Insights
PhotoApp demonstrates state-of-the-art performance in both quantitative and qualitative metrics. It outperforms existing relighting methods on the Scale-invariant Mean Squared Error (Si-MSE), particularly in preserving target lighting intensity and color.
Key findings include:
- Latent Prior Generalization: The model generalizes remarkably well; training on as few as 15 identities allows for the relighting of almost any face. This suggests the StyleGAN latent space is already highly structured for identity and appearance.
- Simultaneous Control: Unlike modular approaches, PhotoAppNet handles pose and lighting changes in a single feed-forward pass, maintaining identity and high-frequency details like specularities.
- Efficiency: The system is highly interactive, with an inference time of approximately 160ms on modern hardware, avoiding the slow per-image optimization required by previous GAN-based methods.
Limitations and Future Work
While highly effective, the model faces challenges with accessories (e.g., glasses or hats) not well-represented in the training data. Backgrounds can occasionally lose consistency at extreme poses, and temporal stability in video sequences remains an area for future improvement. Expanding the range of camera viewpoints beyond the initial light-stage constraints is also a priority for subsequent research.
Summary updated