Skip to content

[CVPR 2025] The code and model for our paper "Shadow Generation Using Diffusion Model with Geometry Prior", CVPR, 2025.

Notifications You must be signed in to change notification settings

bcmi/GPSDiffusion-Object-Shadow-Generation

Repository files navigation

GPSDiffusion-Object-Shadow-Generation

This is the official repository for the following paper:

Shadow Generation Using Diffusion Model with Geometry Prior

Haonan Zhao, Qingyang Liu, Xinhao Tao, Li Niu, Guangtao Zhai
Accepted by CVPR 2025.

Object shadow generation aims to generate plausible shadow for the inserted object in the composite image. We propose Geometry Prior guided Shadow generation Diffusion model (GPSDifffusion), which significantly improves the shadow geometry. The visual comparision between SGDiffusion and our GPSDiffusion is shown below. From left to right, we show the composite image, foreground mask, the result of SGDiffusion, the result of our GPSDiffusion, and ground-truth.

We also provide the visual comparison with other baselines below.

GPSDiffusion has been integrated into our image composition toolbox libcom. Note that the performance of GPSDiffusion is unstable, so you need to generate multiple results and pick the most satisfactory one.

Installation

Environment

conda create -n GPSDiffusion python=3.8
conda activate GPSDiffusion
pip install -r requirements.txt

Training

python train_GPSDiffusion.py

Inference

python infer_GPSDiffusion.py

Post-processing

python post_processing.py

Evaluation

python eval.py

Other Resources

About

[CVPR 2025] The code and model for our paper "Shadow Generation Using Diffusion Model with Geometry Prior", CVPR, 2025.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages