Git Product home page Git Product logo

ps_shadow_extract's Introduction

DeepShadow Shadow Extraction Model

This repository is the code implementation for ECCV 2022 paper supplementary: "DeepShadow: Neural Shape from Shadow".

The overview of our shadow and light extraction architecture is shown below:

Requirements

  • torch > 1.8
  • opencv-python > 4.1
  • numpy
  • kornia > 0.6
  • matplotlib
  • einops > 0.3.1
  • python

Our code was tested using Python 3.7/3.8 under Ubuntu 18.04, with GPU and/or CPU.

Dataset Used for Training

skip this if you don't want to train the model

Download Blobby and Sculptures dataset by Chen et al. (taken from here - https://github.com/guanyingc/SDPS-Net) Torch data loading code also taken from here.

Download our PhotometricStereo Shadow data - (coming soon!)

Run Inference using the model

  1. Clone the repo -
git clone https://github.com/asafkar/ps_shadow_extract.git
cd ps_shadow_extract/
  1. Download the model checkpoint
# get the checkpoint from the git lfs
git lfs install
git lfs fetch
  1. Install requirements
pip install -r requirements.txt
  1. Use the pretrained model to estimate shadows and lights directions

refer to run_model_example.ipynb

Train the model from scratch

  1. Download and unzip the data, place all 3 datasets in the same folder. Indicate the folder when training by using arg --base_dir

  2. Train the model

CUDA_VISIBLE_DEVICES=<gpus> python -m torch.distributed.run --nproc_per_node=<num_gpus> train.py --base_dir=<dir>

Citation

If you use the model or dataset in your own research, please cite:

@inproceedings{karnieli2022deepshadow,	
		title={DeepShadow: Neural shape from shadows},
		author={Asaf Karnieli, Ohad Fried, Yacov Hel-Or},	
		year={2022},	
		booktitle={ECCV},
}

ps_shadow_extract's People

Contributors

asafkar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.