Giter Site home page Giter Site logo

pytorch_deeplab_large_fov's Introduction

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:

  • Find links for downloading the PASCAL VOC 2012 dataset, and PASCAL VOC Augmented dataset.
  • Convert Ground truth files to an easier to access format.

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,

  • 1: use 'step' learning policy.

    • batch size: 20
    • maximum iterations: 6000
    • learning rate decay policy: multiply by 0.1 every 2000 iterations.
  • 2: use 'poly' learning policy.

    • batch size: 10
    • maximum iterations: 20000
    • learning rate decay policy: multiply by $\big( (1- \frac{iter}{max_iter})^{power} \big)$ every iteration.

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,

  • <list_path> is the path to the text_file which consist of names training image(For eg: train_aug.txt) ,
  • <im_path> is the path to the folder containing image files, and
  • <gt_path>is the path to the folder containing ground-truth files.

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,

  • <model_path> is the path to your saved model,
  • <im_path> is the path to the folder containing test images,
  • <im_list> is the path to file containing, and
  • <save_path> is the path to folder where you want to save the output.

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,

  • predict_path is the path to folder containing predicted segmentation maps.
  • gt_path is the path to folder containing ground truth segmentation maps.
  • id_file is the path to file with image names.

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.

pytorch_deeplab_large_fov's People

Contributors

bardofcodes avatar

Watchers

 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.