Code Monkey home page Code Monkey logo

shlight's Introduction

SHLight

These are codes of the paper Learning Scene Illumination by Pairwise Photos from Front and Rear Mobile Cameras. For more details about our work (paper, slide, demo and dataset), please see the project page.

Dependencies

  • Python >= 3.6.0
  • Opencv >= 3.4.0
  • Tensorflow >= 1.7.0

Usage

  1. Download codes, data, models and weights from here.
  2. Unzip the downloaded package. It contains all the files you need to run.
  3. cd to the path: src/, and run following commands.

Train

python3 train.py {Network} {Method} {Fusion} {Weight} [GPU]

we supply some pretrained models. If you want to use these pretrained models, download them and run predict.py or evaluate.py directly. If you want retrain these models, please modify the value of model_root in common.py before training, otherwise the program will continue training from our pretrained models.

Evaluate

python3 evaluate.py {Network} {Method} {Fusion} {Weight} [GPU]

Predict

python3 predict.py {Network} {Method} {Fusion} {Weight} [GPU]

It will predict SH coefficents from pairwise images according to the data/list/pred.txt. You can predict the SH coefficients from other images by modifing this file (or modify the function gen_pred_txt() in predict.py).


Arguments
  • Network - [alexnet | vgg16 | googlenet | resnet]
    • the feature extraction network
  • Method - [freeze | fromscratch | finetune]
    • the method of treating the feature extraction network.
  • Fusion - [concat | subtract]
    • the method of fusing the features
  • Weight - float value
    • the weight of the SH loss, and 1 - Weight is the weight of the render loss.
  • GPU - optional, string of digitals
    • specify the gpu device(s) for running. default: 0.
for example
python3 train.py alexnet freeze concat 0.8

Then it will use alexnet as the backbone network, freeze the pretrained weights during traning, fuse extracted features by concatenation, and use 0.8*SHLoss + 0.2*RenderLoss as the loss function. Since GPU device was not specified, it will be default running on gpu device: 0.

This is also the best model in our paper (alexnet, freeze, concat, 0.8), you can use this model to compare with other works.

Trouble Shooting

shlight's People

Contributors

sklcg avatar

Watchers

James Cloos 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.