Git Product home page Git Product logo

light-estimation's Introduction

Light-Estimation

Introduction

Lighting estimation is difficult task. Many optimization based methods estimates lighting using Spherical Harmonics. Spherical harmonics cannot model all types of shading. Unfortunately, due to lack of ground truth for real images, lighting estimation becomes even more difficult task. Hence, we have used adversarial networks to bridge the gap between synthetic and real images.

We have -

  1. Implemented LDAN which uses Generative Adversarial Networks for domain adaptation
  2. Implemented Denoising Autoencoder to compare against Adversarial method for lighting estimation

Structure

  1. LDAN folder contains domain adaptation implementation
    • models.py - FeatureNet, LightingNet, Generator
    • train.py - Training FeatureNet, LightingNet and Generator
    • shading.py - Utility methods for generating Shading from Face normal and Spherical harmonics
    • utils.py - Misc utility methods required for saving images and other
    • dataLoading.py - loading CelebA data, SfSNet synthetic data and LDAN synthetic data
    • LDAN/exp_1.py - Experiement 1 below
    • LDAN/exp_2_training_with_sirfs_sh.py - Experiement 2 below
    • LDAN/exp_2_training_with_true_sh.py - Experiment 3 below
    • AutoLighting/resNet_CelebA.py - Experiment 4 with CelebA
    • AutoLighting/resNet_sfsNet.py - Experiment 5 with SfSNet dataset

Experiements performed

  1. Estimating lighting of CelebA

    • Trained with LDAN Synthetic dataset
    • Real Image dataset: CelebA
    • SIRFS SH for training GAN: Using SIRFS method to generate SH for CelebA dataaset
    • Ground truth for training feature net and lighting net - provided in LDAN dataset
    • Conclusion- Synthetic images space was adapted by the net
  2. Estimating lighting of SfSNet dataset with SIRFS SH for GAN training

    • This is to verify estimated shading with ground truth shading
    • Training on LDAN synthetic dataset
    • Used SIRFS SH for training GAN: Using SIRFS method to generate SH for SfSNet dataset
    • Ground truth Normal, Shading for SfSNet dataset provided
    • MSE plot with respect to SIRFS SH goes down and with respect to ground truth SH increases verifying that SIRFS domain is being adapted
    • Conclusion- Although results are not better than SIRFS estimated shading, we can see domain being adapted
  3. Estimating lighting of SfSNet dataset with ground truth SH for GAN training

    • This is to verify estimated shading with ground truth shading
    • Training on LDAN synthetic dataset
    • Used ground truth SH for training GAN
    • Ground truth Normal, Shading for SfSNet dataset provided
    • MSE plot with respect to SIRFS SH increases and with respect to ground truth decrease i.e. opposite to Experiment 2
    • Conclusion- Although results are not better than SIRFS estimated shading, we can see domain being adapted
  4. AutoLighting

    • This was to compare domain adaptaion with respect to denoising autoencoder
    • Steps -
      1. Generate Noisy SH using SIRFS method on SfSNet data
      2. Train denoising autoencoder to denoise SH
      3. Use trained denoising autoencoder to remove noise from SH on real images SH
      4. Use Use feature net and lighting net to estimate lighting on real images
    • This approach does not out performs domain adaptation
    • Conclusion - Synthetic and real images spaces are different and adversarial approach performs well to understand and estimate lighting for real images trained on synthetic images.

Results

  1. Lighting Estimation for CelebA dataset - trained with LDAN Synthetic dataset

Real Image input

SIRFS generated shading LDAN generated shading
Shading by SIRFS Shading by LDAN(ours)
LDAN generated shading Without domain adaptation
Shading with Domain Adaptation Shading without Domain Adaptation
  1. Lighting Estimation for SfSNet dataset - trained with LDAN Synthetic dataset

Real Image input

SIRFS generated shading LDAN generated shading
Shading by SIRFS Shading by LDAN(ours)
LDAN generated shading Without domain adaptation
Shading with Domain Adaptation Shading without Domain Adaptation
  1. Lighting Estimation for SfSNet dataset - trained with SfSNet Synthetic dataset

Real Image input

SIRFS generated shading LDAN generated shading
Shading by SIRFS Shading by LDAN(ours)
LDAN generated shading Without domain adaptation
Shading with Domain Adaptation Shading without Domain Adaptation
  1. Lighting Estimation by AutoLighting (Denoising AutoEncoder) for CelebA dataset - trained with SfSNet Synthetic dataset

Real Image input

SIRFS generated shading LDAN generated shading
Shading by SIRFS Shading by LDAN(ours)

Slide & Report

Slides

Project Report

light-estimation's People

Contributors

bhushan23 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.