Rishubh Parihar
·
Sachidanand VS
·
Venkatesh Babu R
Indian Institute of Science
|
- [2025.07.15] Release inference & Gradio demo code for depth aware object placement and scene composition tasks.
- [Soon] Release the benchmarking dataset for both tasks.
Install with conda:
conda env create -f environment.ymlFor object placement we use AnyDoor for inpainting, download the weights from:
Note: They include all the optimizer params for Adam, so the checkpoint is big. You could only keep the "state_dict" to make it much smaller.
Download DINOv2 checkpoint and revise /configs/anydoor.yaml for the path (line 83)
Or to simply download all the weights, run the download_weights.sh script:
mkdir weights
bash download_weights.sh
We provide inference code for both depth aware object placement and scene composition. You should place the images in respective folder under examples/gradio and modify the image path and run the following code, some sample input images are given in examples folder. The generated results are provided in results/object_placement for object placement image, and results/scene_comp for scene composition.
# for Depth aware object placement
python run_inference_object_placement.py
# for Depth aware Scene composition
python inference_scene_composition.pyCurrently, we suport local gradio demo for both object placement and scene composition inference. To launch it run the correspondint scripts:
This demo allows you to place objects into scenes with depth-aware positioning.
Running the Demo:
python gradio_demo_op.pyUsage Instructions:
- Upload a background image and draw a mask where you want to place the object preferably a bounding box.
- Upload a reference object image (RGBA with transparency)
- The system will plot a coloured point cloud of the scene in front view and top view.
- Adjust the depth value as per where you want to place an object in the scene based on the top view plot.
- The generated image will show the object placed at the specified depth
This demo enables depth-aware scene composition by combining multiple elements.
Running the Demo:
python gradio_demo_sc.pyUsage Instructions:
- Upload a background image
- Upload a foreground object image
- Upload a mask image (white for foreground, black for background)
- Provide text prompts describing:
- Background scene
- Foreground object
- Desired final composition
- Generate the composed scene
The gradio demo would look like the UI shown below:
|
This project is developed on the codebase of Anydoor and DiffusionHandles. We appreciate these great work!
If you find this codebase useful for your research, please use the following entry.
@inproceedings{rishubh2025zeroshot,
title = {Zero-Shot Depth-Aware Image Editing with Diffusion Models},
author = {Rishubh Parihar, Sachidanand VS, R. Venkatesh Babu},
booktitle = {International Conference on Computer Vision (ICCV)},
year = {2025},
}
