jaedong27 / shadow-removal-code-archive

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Learning to Remove Soft Shadows - code archive

This repository contains the code for our 2015 ACM Transactions on Graphics paper "Learning to Remove Soft Shadows".

This is mostly for reference - it has been a long while since I ran this and I do not have access to the machine where everything used to be set up. Consequently, it will take quite a bit of work to get things to run, from fixing all the hard-coded paths to compiling the C++ code to generating the training data and figuring out the correct place to put it. While I probably won't be able to help with individual requests, here is the overall structure of how things worked:

  • A complimentary repository shadow_gen contains the code used to generate the training data (shadowed-unshadowed image pairs).
  • PenumbraRemoval is the core algorithm written in C++. It can do either training or evaluation using an already-trained model, depending on the options given. PenumbraDataInspection is a helper library and RandomForest contains an implementation of Mutlivariate Regression Random Forest that's used at the core of our shadow removal algorithm.
  • prem_integration contain a bunch of glue code in Python that actually made things run and launch the compiled binaries described above. A good starting point for looking through it is prem_integration/run.py. A thing to note are the options files, prem_options.txt and local_options.txt, which control how things run (e.g. whether we're training or testing/evaluating), specify learning parameters such as number of trees in the Random Forest, their depth etc., as well as specify paths to where to find things. The paths in prem_options.txt are relative to whatever is defined in local_options.txt.
  • Another interesting thing is a script to automate image inpainting using Adobe Photoshop's "context-aware fill" functionality: prem_integration/inpaint_file.jsx. This JavaScript file was turned into a corresponding .exe, which would then launch Photoshop itself and do the inpainting. If you want more details about this part, the Photoshop JS Scripting Reference is probably a good place to start.
  • experiments is mostly dysfunctional - it was a place, where I evaluated the impact of the size of the training set on the final result; there might be some interesting things there (including some compiled binaries), so I've left it in.
  • Finally, Scribbler contains a small Qt application that was used to create the binary shadow masks by painting over selected images.

I hope this is helpful - thanks for your interest in our work and best of luck in digging through this code and possibly even resurrecting it. If you manage to get something useful out of it - let me know!

About


Languages

Language:C++ 76.9%Language:Python 21.0%Language:JavaScript 1.1%Language:MATLAB 0.8%Language:Batchfile 0.1%