[contact : nishit.soni@research.iiit.ac.in (or) nishitiiith@gmail.com ]

Before running the code : 
1. Download the following files from : http://cvit.iiit.ac.in/projects/semanticBoundaries/dataset.html
dataset.zip, pbMatFiles.zip, groundtruth.zip, nyu100.zip (if you want to run our code on the 100 images from NYU dataset)

Now extract pbMatFiles.zip, dataset.zip and groundtruth.zip and :
2. Move mat files inside pbMatFiles and kinect_dataset/kinect3dMatfiles to the code/mat folder.
3. Move the directories kinect_dataset/rgb and kinect_dataset/depth to the code/kinect_dataset directory.
4. Move groundtruth mat files under groundtruth folder to code/groundtruth 
5. For running the code on NYU dataset, extract nyu100.zip and : 
     i)  move nyu100/rgb, nyu100/depth to code/kinect_dataset directory
     ii) move the mat files under  nyu100/kinect3dMatFiles to code/mat directory

Steps to run the pipeline : 
(Note: parameter "Path" is to be passed as the path of "code" directory)

1. source/feature_extraction.m (feature extraction)
	 INPUT
   parameters: files, Path, featureNo
   files : list of imageNos 
   Path : path to the code directory
   featureNo : features would be saved with the number as suffix
   eg. feature_extraction([100,101,102], '~/code', 0); 
         OUTPUT 
   a. feature vector for each image is saved as <Path>/features/<imageNo>_feature_<featureNo>.mat

2. source/train_random_forest.m (training)
	INPUT
   parameters : Path, classifierNo, featureNo
   Path : path to the code directory
   classifierNo : classifier would be saved with the number as suffix
   featureNo : feature set no
   eg. train_random_forest('~/code',0,0); 
       OUTPUT
   a. the classifier is saved as <Path>/classifier_rf<classiferNo>.mat 

3. source/pipeline.m (test and mrf)
	   INPUT
   parameters : Path, imageNo, classifierNo, featureNo, lambda1, lambda2
   Path : path to code directory
   classifierNo : classifier to be used to test with
   featureNo : feature set no
   lambda1, lambda2 : parameters for MRF (see the paper for more details)
   eg: pipeline('~/code', 100, 0, 0, 1000, 12.5)
            OUTPUT 
   a. classification output is saved as <Path>/mat/Result<imageNo>_<classifierNo>.mat and <Path>/result/Result<imageNo>_<classifierNo>.jpg
   b. mrf output is saved as <Path>/mrf/<imageNo>_graphcut.mat and <Path>/mrf/<imageNo>_graphcut.jpg

4. source/evaluate.m (evaluation)
	 INPUT
   parameters : Path, allFiles, classifierNo
   Path : path to code directory
   allFiles : image file nos to evaluate on
   classifierNo : classifier used for the testing
   eg: evaluate('~/code', [100,101,102], 0)
         OUTPUT
   a. Average classification and MRF evaluations are saved as <Path>/source/rfEvaluation<classifierNo>.mat and <Path>/source/mrfEvaluation<classifierNo>.mat respectively (both of these are also displayed at the end of evaluation).

