BardOfCodes / pytorch_deeplab_large_fov

Pytorch implementation of Deeplab Large-FOV
29 stars 7 forks source link

Pytorch Deeplab Large-FOV

This repository contains training, testing and conversion scripts for using Deeplab Large-FOV (introduced inthis paper), in pytorch.

Set-up

An excellent resource for setting up PASCAL VOC 2012 task, is this repository. By following the instructions there, you can:

To use the same initialization as the authors used, download the initialization caffemodel files here (download 'vgg16_20M.caffemodel').

Converting caffemodel to usable OrderedDictionary

There are two ways of doing this,

1) If you have caffe installed: You can easily use the converter.py script.

2) If you do not have caffe(or dont want to install it): You can try to use code from this repository

For converting using converter.py, use:

python converter.py <caffe_path> <model_caffemodel> <model_prototxt>

where, <caffe_path>, <model_caffemodel> and <model_prototxt> are paths to the respestive entities.

Training

There are two training regime for Deeplab Large-FOV version 1,

for training the networks, use:

python train_v1.py <list_path> <im_path> <gt_path>
or
python train_v2.py <list_path> <im_path> <gt_path>

where,

For additional options, use:

python train_v1.py -h

Testing

For saving the output of your trained network, use

python test.py <model_path> <im_path> <im_list> <save_path>

where,

For additional options, use:

python test.py -h

Evaluation

For evaluation you can use code here. It has been linked as a submodule of this repository.

Use:

python demo.py find_metrics predict_path gt_path id_file

where,

Results

The performance of Deeplab Large-FOV trained in pytorch is different from it's performance when trained in caffe (which can be validated by following @martinkersner/train-DeepLab).

The following table list the mean IOU accross the 21 classes in Pascal VOC 2012. The results are for the 'val' set.

Training Regime Training Regime 1 Training Regime 2
With Dropout layers 61.576 % 65.22 %
Without Dropout layers 63.570 % 65.65 %
From Caffe 62.25 % 65.88 %

Important Note: Dropout Layers are being disabled by using model.eval(), instead of model.train() in the 'train_v1/2.py' scripts.

Acknowlegdement

I would like to thank :

Also, a big thanks to Video Analytics Lab.