Code Monkey home page Code Monkey logo

semantic-segmentation's Introduction

Semantic Segmentation

๐Ÿšง This project still under development. Some scripts might be incomplete. ๐Ÿ—

Semantic segmentation has become an important component of self-driving vehicles. It allows the car to understand the surroundings by classifying every pixel of the input image.

๐Ÿƒ๐Ÿปโ€โ™‚๏ธ Running...

To run inference on the pre-trained models, please use segmentor.py.

from segmentor import Segmentor
seg = Segmentor()
classes_output, img_viz = seg.semantic_segmentation(image=image, visualization=True)

classes_output is the pixel-wise classification result for all the categories. img_viz is a RGB image generated based on classes_output

The best way to run some actual test is using test.py. You must specify the image path by changing the path variable.

The pre-trained weights are stored in the ./weights directory.

The Cityscape Dataset ๐Ÿ’ผ

In order to train the model, please download the cityscape dataset, which can be found here.

Remeber to preprocess the data using this jupyter notebook: Data Preprocessing.ipynb. The script will generate train_labels.csv and val_labels.csv

My data is organized as such:

Cityscape
โ”‚   train_labels.csv
โ”‚   val_labels.csv 
โ””โ”€โ”€โ”€ training
โ”‚   โ””โ”€โ”€โ”€ aachen
โ”‚   โ””โ”€โ”€โ”€ augsburg
โ”‚   .
โ”‚ 	.
โ””โ”€โ”€โ”€ training_gt
โ”‚   โ””โ”€โ”€โ”€ aachen
|   โ””โ”€โ”€โ”€ augsburg
|	.
|	.
โ””โ”€โ”€โ”€ val
โ”‚   โ””โ”€โ”€โ”€ frankfurt
โ”‚   โ””โ”€โ”€โ”€ lindau
โ””โ”€โ”€โ”€ val_gt
|   โ””โ”€โ”€โ”€ frankfurt
|   โ””โ”€โ”€โ”€ lindau

Training

There are two training scripts:

  • train_icnet.py
  • train_fusion.py

train.py is the ICNet training script. utils.py contains all the categories (classes). You can modify them based on your dataset.

Models

An overview of the different segmentation models in this project.

ICNet

ICNet (or image cascade network) is a realtime semantic segmentation model developed by Zhao et al. at The Chinese University of Hong Kong. Their paper shows that ICNet can achieve mIoU of ~70% with the Cityscape dataset, while running at ~30 FPS. After some testing, ICNet became a great choice for self-driving applications. (I am currently using the network on my self-driving golf cart project)

Here is a simple benchmark comparison between ICNet and other popular semantic segmentation models. These images and visualizations are from the original ICNet paper, which can be found here.

image

FusionNet ๐Ÿค”

Coming soon...

About

This project is created for the self-driving golf cart project that I have been working on. For more information on that, please refer to the Github page, or my website.

If you have questions, comments or concerns, please contact me at [email protected].

semantic-segmentation's People

Contributors

neilnie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

semantic-segmentation's Issues

How to obtained Weights?

Hi,

I was wondering where are the weights for the models. There is no directory called ./weights in this repository.

Thanks.

What do we mean by "training doesn't work very well"?

In the readme file, there is a mention - "training doesn't work very well."

What does it mean by that? Request you to please elaborate.

Also, if there is a way to fix it, please suggest.

Also, can you suggest what is the size of the training data required for training?

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.