Code and Data

The code and data are available as separate tarballs:

Unpack the tarballs and merge if necessary. The top-level folder, named
MIT-intrinsic by default, should contain the README, four python
files, the data folder, and an empty results folder.

The four python files are:

After installing the required packages (see below), you should be able to
reproduce most of the results from the paper by running
cd MIT-intrinsic python
This will evaluate the algorithms using hold-one-out cross-validation. It prints
results to the console, and also saves the shading/reflectance decompositions and
their error scores to the HTML file results/index.html. If you change the USE_L1
variable (defined in to True, it will use the L1 penalty for
reconstruction rather than least squares. In this case, the outputs will be saved to

We have done our best to provide a code base which is readable, compact, and easy to extend.

Please send your questions and comments to Roger Grosse (rgrosse at mit dot edu).


To run the code, you will need Python as well as the following
Python libraries:

Detailed installation instructions for a variety of platforms are provided below.


At the time of writing, the latest PyAMG installer was for Python 2.5. To keep the process
simple, we have tested our software against Python 2.5.

Download and run the installers for the following packages:

  1. Python.
    We have tested Python 2.5.4.
  2. Numerical Python.
    We have tested numpy-1.3.0-win32-superpack-python2.5.exe.
  3. SciPy.
    We have tested scipy-0.7.1-win32-superpack-python2.5.exe.
  4. PyPNG.
  5. PyAMG.
    We have tested pyamg-1.0.0.win32-py2.5.exe.
    Note that we had to download msvcr71.dll and install it in

We also recommend:

  1. iPython.
    We have tested ipython-0.10.
  2. PyReadline.
    We have tested pyreadline-1.5-win32-setup.exe.

If all packages are installed correctly, you can run the code by
double-clicking from within Windows Explorer.

Mac OS X

We encountered issues with the installers for NumPy and SciPy when attempting to
install on a standard OS X 10.5 Leopard system. To get around
these issues, we used third-party installers as described below.

  1. Scipy Superpack for NumPy and SciPy.
    Download the shell script and execute it to install NumPy and SciPy.
  2. PyAMG.
    We have tested pyamg-1.0.0-py2.5-macosx10.5.dmg.
  3. PyPNG.