No description
  • Python 99.7%
  • Shell 0.3%
Find a file
2026-06-29 11:03:38 +00:00
depth Manually edited depth map. 2020-05-19 21:16:23 +08:00
image Upload samples files 2020-04-10 02:30:02 +08:00
MiDaS Manually edited depth map. 2020-05-19 21:16:23 +08:00
previews docs: add link to final assembled 45-minute master cut 2026-06-29 11:03:38 +00:00
video Manually edited depth map. 2020-05-19 21:16:23 +08:00
.gitignore Manually edited depth map. 2020-05-19 21:16:23 +08:00
argument.yml docs: add asynchronous interleaved pipeline concept to future works 2026-06-28 01:04:01 +00:00
bilateral_filtering.py Merge pull request from 'safijari' 2020-05-01 22:46:46 +08:00
boostmonodepth_utils.py add BMD code 2021-06-21 03:16:45 -04:00
DOCUMENTATION.md add support to BoostMonocularDepth 2021-06-21 02:25:11 -04:00
download.sh change url to filebox for faster download 2021-06-21 13:20:34 -04:00
FUTURE_WORKS.md docs: add asynchronous interleaved pipeline concept to future works 2026-06-28 01:04:01 +00:00
LICENSE Upload samples files 2020-04-10 02:30:02 +08:00
main.py add support to BoostMonocularDepth 2021-06-21 02:25:11 -04:00
mesh.py Sync local and remote 2020-05-04 14:34:38 +08:00
mesh_tools.py Edit mesh_tools.py, mesh.py, utils.py to accel. 2020-05-01 21:31:03 +08:00
networks.py fix cpu device bug 2020-04-11 14:11:49 -04:00
pyproject.toml Merge pull request from 'safijari' 2020-05-01 22:46:46 +08:00
README.md docs: add FUTURE_WORKS.md with architectural insights for V2 upgrades 2026-06-28 00:40:42 +00:00
requirements.txt Additional changes 2020-05-04 14:00:54 +08:00
utils.py Manually edited depth map. 2020-05-19 21:16:23 +08:00

[CVPR 2020]# 3D Photo Inpainting Archive (Standalone Fork)

Note

Custom Fork Archive: This repository is a standalone fork of the original vt-vl-lab/3d-photo-inpainting. The original academic server hosting the neural network weights went offline, breaking the installation script. We have recovered the weights and hosted them permanently on our own S3 bucket. To install: Do not use download.sh. Instead, run bash setup_from_s3.sh. Future Works: See FUTURE_WORKS.md for architectural insights and ways to upgrade this pipeline for modern V2 usage.


3D Photography using Context-aware Layered Depth Inpainting

Open 3DPhotoInpainting in Colab

[Paper] [Project Website] [Google Colab]

We propose a method for converting a single RGB-D input image into a 3D photo, i.e., a multi-layer representation for novel view synthesis that contains hallucinated color and depth structures in regions occluded in the original view. We use a Layered Depth Image with explicit pixel connectivity as underlying representation, and present a learning-based inpainting model that iteratively synthesizes new local color-and-depth content into the occluded region in a spatial context-aware manner. The resulting 3D photos can be efficiently rendered with motion parallax using standard graphics engines. We validate the effectiveness of our method on a wide range of challenging everyday scenes and show fewer artifacts when compared with the state-of-the-arts.

3D Photography using Context-aware Layered Depth Inpainting
Meng-Li Shih, Shih-Yang Su, Johannes Kopf, and Jia-Bin Huang
In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.

Prerequisites

  • Linux (tested on Ubuntu 18.04.4 LTS)
  • Anaconda
  • Python 3.7 (tested on 3.7.4)
  • PyTorch 1.4.0 (tested on 1.4.0 for execution)

and the Python dependencies listed in requirements.txt

  • To get started, please run the following commands:
    conda create -n 3DP python=3.7 anaconda
    conda activate 3DP
    pip install -r requirements.txt
    conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit==10.1.243 -c pytorch
    
  • Next, please download the model weight using the following command:
    chmod +x download.sh
    ./download.sh
    

Quick start

Please follow the instructions in this section. This should allow to execute our results. For more detailed instructions, please refer to DOCUMENTATION.md.

Execute

  1. Put .jpg files (e.g., test.jpg) into the image folder.
    • E.g., image/moon.jpg
  2. Run the following command
    python main.py --config argument.yml
    
    • Note: The 3D photo generation process usually takes about 2-3 minutes depending on the available computing resources.
  3. The results are stored in the following directories:
    • Corresponding depth map estimated by MiDaS
      • E.g. depth/moon.npy, depth/moon.png
      • User could edit depth/moon.png manually.
        • Remember to set the following two flags as listed below if user wants to use manually edited depth/moon.png as input for 3D Photo.
          • depth_format: '.png'
          • require_midas: False
    • Inpainted 3D mesh (Optional: User need to switch on the flag save_ply)
      • E.g. mesh/moon.ply
    • Rendered videos with zoom-in motion
      • E.g. video/moon_zoom-in.mp4
    • Rendered videos with swing motion
      • E.g. video/moon_swing.mp4
    • Rendered videos with circle motion
      • E.g. video/moon_circle.mp4
    • Rendered videos with dolly zoom-in effect
      • E.g. video/moon_dolly-zoom-in.mp4
      • Note: We assume that the object of focus is located at the center of the image.
  4. (Optional) If you want to change the default configuration. Please read DOCUMENTATION.md and modified argument.yml.

License

This work is licensed under MIT License. See LICENSE for details.

If you find our code/models useful, please consider citing our paper:

@inproceedings{Shih3DP20,
  author = {Shih, Meng-Li and Su, Shih-Yang and Kopf, Johannes and Huang, Jia-Bin},
  title = {3D Photography using Context-aware Layered Depth Inpainting},
  booktitle = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year = {2020}
}

Acknowledgments