Inserting Videos Into Videos

Donghoon Lee, Tomas Pfister, Ming-Hsuan Yang

Abstract

Automatically inserting objects into video scenes is a complex task requiring high temporal consistency and realistic blending without the luxury of paired ground-truth data. This paper presents a self-supervised framework that learns to blend objects into new environments by training on synthetic "fake" pairs and utilizing a temporal history mechanism. By injecting noise to prevent "lazy" learning, the model achieves seamless, flicker-free results. Evaluation on benchmark datasets like DukeMTMC and TownCenter shows that the synthesized videos are realistic enough to significantly improve the performance of object detectors through data augmentation.

Introduction: The Challenge of Video Object Insertion

Object insertion—the process of placing a new element into an existing scene—is a fundamental tool in visual effects and photo editing. While relatively straightforward for static images, extending this to video introduces significant hurdles. The primary challenge is the lack of unpaired data: researchers rarely have access to "ground truth" videos of the same subject in different environments.

Furthermore, simple "copy-paste" methods often result in a "sticker-like" appearance or distracting "flickering" due to mismatched lighting, shadows, and edge artifacts. Traditional solutions often rely on expensive, manually-labeled pixel-perfect segmentation masks or generative models that lack fine-grained control over the object's appearance. This work addresses these issues by framing video insertion as an unsupervised video-to-video translation problem.

A pedestrian realistically inserted into a stone courtyard scene, demonstrating the model's ability to handle complex backgrounds.

Methodology

The proposed framework employs three key strategies to achieve realistic and stable video composites:

1. Self-Supervision via Synthetic Pairs

To overcome the lack of paired training data, the authors created "fake" pairs. By taking an object and a background from the same video and blending them together crudely, the network is tasked with reconstructing the original, clean frame. This process teaches the model to remove blending artifacts and restore natural edges and lighting.

2. Temporal Consistency and Noise Injection

To prevent flickering, the video generator ($G_V$) utilizes a U-Net architecture that considers the current blended frame alongside a history of $N$ previously synthesized frames.

A sequence of frames demonstrating the temporal consistency of an inserted pedestrian moving along a street.

To ensure the model doesn't simply copy-paste from previous frames (a "lazy" learning behavior), the authors implemented an "Anti-Cheating" Mechanism. By injecting random noise into the previous frames during training, the model is forced to learn the semantic relationship between the object and its new environment, effectively acting as a denoiser that understands scene context.

3. Adversarial Training

The system employs both image-level and video-level discriminators. This dual-adversarial approach ensures that individual frames are sharp and that the overall motion across the video remains realistic and fluid.

Datasets and Evaluation

The method was rigorously tested on three major computer vision benchmarks:

  • DukeMTMC: A multi-camera tracking dataset featuring pedestrians.
  • TownCenter: High-definition footage of a busy urban area.
  • UA-DETRAC: A challenging dataset focused on vehicle detection in diverse traffic conditions.

Key Results

The proposed method demonstrated superior visual realism compared to baselines like Poisson blending. A key metric for success was the "realism" perceived by other AI systems. When running a YOLOv3 object detector on the synthesized videos, the method achieved a recall of 0.86, significantly higher than the 0.76 achieved by segmentation-based baselines.

Perhaps most importantly, the synthesized data proved valuable for training. Augmenting a pedestrian detector's training set with 3,000 synthesized frames led to a jump in Mean Average Precision (mAP) from 53.1% to 68.3%, highlighting the potential for high-quality data augmentation.

Limitations and Future Directions

Despite its success, the current system has limitations. Inserted objects do not yet "interact" with the scene geometry—for instance, they cannot walk behind a tree or navigate around obstacles. Future research will focus on integrating 3D scene understanding and path planning to allow for more complex and logical object interactions within the target video.

Summary updated

BibTeX
@inproceedings{lee2019inserting,
  author = {Donghoon Lee and Tomas Pfister and Ming-Hsuan Yang},
  title = {{Inserting Videos Into Videos}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.01030},
}
Figure