Coder Social home page Coder Social logo

kywang / gfrnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrochan/gfrnet

0.0 2.0 0.0 6.75 MB

Dense image labeling in Caffe

License: MIT License

CMake 1.47% Makefile 0.34% C++ 40.31% C 0.03% MATLAB 0.70% HTML 0.10% CSS 0.13% Shell 0.26% Jupyter Notebook 48.99% Python 4.28% Cuda 2.61% M 0.01% Protocol Buffer 0.78%

gfrnet's Introduction

G-FRNet: Gated Feedback Refinement Network for Dense Image Labeling

This repository contains code for the paper

Gated Feedback Refinement Network for Dense Image Labeling,
Presented at CVPR 2017

The paper addresses the problem of dense image labeling, where the goal is to label each pixel in an image. The proposed model is an encoder-decoder-based deep convolutional neural network that is trained in an end-to-end fashion. The network architecture is inspired by the SegNet architecture.

If you find this code useful in your research, please cite:

@InProceedings{Islam_2017_CVPR,
author = {Amirul Islam, Md and Rochan, Mrigank and Bruce, Neil D. B. and Wang, Yang},
title = {Gated Feedback Refinement Network for Dense Image Labeling},
booktitle = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {July},
year = {2017}
}

Setting up Caffe-gfrnet and the Dataset

G-FRNet requires a modified version of caffe to run. Please download and compile caffe-gfrnet to use these models.

We used the CamVid dataset which contains 367 training and 233 testing images of road scenes. We used an 11 class version with an image size of 360 by 480. Download this data in the format required for G-FRNet from this GitHub repository.

You now need to modify CamVid/train.txt and CamVid/test.txt so that G-FRNet knows where to find the data. G-FRNet requires a text file of white-space separated paths to images (.jpg or .png) and corresponding label images (.png) alternatively, e.g.

/path/to/image1.png /another/path/to/label1.png 
/path/to/image2.png /path/label2.png ...

Please open up these two files in a text editor and use the find & replace tool to change to the absolute path of your data.

Training G-FRNet

The next step is to set up a model for training. First, open the model file Models/CamVid/train_camvid_gate.prototxt and inference model file Models/CamVid/test_camvid_gate.prototxt. You will need to modify the data input source line in all the model's data layers. Replace this with the absolute directory to your data file. Secondly, please open the solver file Models/CamVid/solver_camvid_gate.prototxt and change two lines; the net and snapshot_prefix directories should match the directory to your data.

We are now ready to train G-FRNet! Open up a terminal and issue these commands:

sh run_camvid_train.sh

Testing G-FRNet

First, open up the scripts Scripts/compute_bn_statistics_camvid.py and Scripts/test_segmentation_camvid.py and change to the directory to your G-FRNet Caffe installation.

We are now ready to test G-FRNet! Open up a terminal and issue this command:

sh run_camvid_test.sh

We use the Batch Normalization layers in G-FRNet that shift the input feature maps according to their mean and variance statistics for each mini batch. The test script firstly run the script Scripts/compute_bn_statistics_camvid.py and saves the final test weights in the output directory as /Models/CamVid/Inference/test_weights.caffemodel. Finally the test script run test_segmentation_camvid.py which save the final predictions for each test image.

Initialization & Pretrained Models

The initialization and pretrained models are provided here. Please download and put it in the relative path of your directory.

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.