Git Product home page Git Product logo

road-detection-using-fcn's Introduction

Vision-Based Road Detection using FCN

Overview

The main purpose of this work is to develop a component of self-driving car that can be used for road detection. An input for this component is a single RGB image, and an output is a mask that shows road areas in the image. I employed Fully Convolutional Network (FCN) that is known to be significantly useful for semantic segmentation. However, such techniques require massive efforts to generate a large dataset that has ground truth.

Now, state-of-the-art object detection algorithms show great performance, so I believe that pixel-level segmentation for every objects is not always necessary for practical applications. So I developed an FCN-based approach that focuses only on road, that cannot be dealt with the conventional object detection algorithms. The annotation efforts can be significantly reduced if we can limit the region of interest only to road.

FCN Architecture

I employed the following U-Net architecture.

Setup

Prerequisites

  • Linux
  • Python 3.5
  • numpy
  • PyTorch 0.4.1
  • OpenCV

All these modules area quite popular, so you can easily find how to install them on the Internet.

Datasets

Currently, I assume that the model is trained and tested on The Cityscapes Dataset. Download the following two packages. (You need to make an account.)

Unzip and place them under ./datasets/cityscapes as follows:

datasets/

 └ cityscapes/

   ├ gtFine_trainvaltest/

   └ leftImg8bit_trainvaltest/

Call preprocess.py to create training and validation data.

python preprocess.py

This will create 2,975 training images and 500 validation images in ./datasets/cityscapes/train and ./datasets/cityscapes/val, respectively.

Train

python train.py

During training, models and sample results are saved to ./saved_models and ./images, respectively. Use -h to see options.

It will take around 3 min. for 1 epoch using NVIDIA GeForce GTX 1080 Ti.

Test

python test.py --model model_path

This will run the model named model_path on all images in ./datasets/cityscapes/val. Result images are saved to ./results.

You will find the following two types of images in ./results. The left image is an output (mask) of the FCN and the right image highlights the detected road area in the input image. These images are saved as result_*.png and synthesized_*.png, respectively.

Model and Results

You can download the pre-trained model (after 50 epochs) and the results generated by the model from the following links.

road-detection-using-fcn's People

Contributors

kzykmyzw avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.