GithubHelp home page GithubHelp logo

dhkim0225 / keras-image-segmentation Goto Github PK

View Code? Open in Web Editor NEW
169.0 13.0 66.0 33.37 MB

Image segmentation with keras. FCN, Unet, DeepLab V3 plus, Mask RCNN ... etc.

License: MIT License

Python 100.00%

keras-image-segmentation's Introduction

Keras Image Segmentation

Semantic Segmentation easy code for keras users.


We use cityscape dataset for training various models.

Use pretrained VGG16 weight for FCN and U-net! You can download weights offered by keras.

Tested Env

  • python 2 & 3
  • tensorflow 1.5
  • keras 2.1.4
  • opencv 3.3

File Description

File Description
train.py Train various models.
test.py Predict one picture what you want.
dataest_parser/make_h5.py Parse cityscape dataset and make h5py file.
dataest_parser/generator.py Data_generator with augmentation using data.h5
model/ Folder that contains various models for semantic segmentation
segmentation_dh/ Experiment folder for Anthony Kim(useless contents for users)
segmentation_tk/ Experiment folder for TaeKang Woo(useless contents for users)
temp/ Folder that contains various scripts we used(useless contents for users)

Implement Details

We used only three classes in the cityscape dataset for a simple implementation.

Person, Car, and Road.

Simple Tutorial

First, you have to make .h5 file with data!

python3 dataset_parser/make_h5.py --path "/downloaded/leftImg8bit/path/" --gtpath "/downloaded/gtFine/path/"

After you run above command, 'data.h5' file will appear in dataset_parser folder.

Second, Train your model!

python3 train.py --model fcn
Option Description
--model Model to train. ['fcn', 'unet', 'pspnet']
--train_batch Batch size for train.
--val_batch Batch size for validation.
--lr_init Initial learning rate.
--lr_decay How much to decay the learning rate.
--vgg Pretrained vgg16 weight path.

Finally, test your model!

python3 test.py --model fcn
Option Description
--model Model to test. ['fcn', 'unet', 'pspnet']
--img_path The image path you want to test

Todo

  • FCN
  • Unet
  • PSPnet
  • DeepLab_v3
  • Mask_RCNN
  • Evauate methods(calc mIoU)

Contact us!

Anthony Kim: [email protected]

TaeKang Woo: [email protected]

keras-image-segmentation's People

Contributors

dhkim0225 avatar tkwoo 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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keras-image-segmentation's Issues

After resolving _init_.py...

Traceback (most recent call last):
File "train.py", line 42, in
lr_init=lr_init, lr_decay=lr_decay, vgg_weight_path=vgg_path)
File "/home/atsushi/keras/work/keras-image-segmentation/model/fcn.py", line 111, in fcn_8s
x = Lambda(lambda x: tf.image.resize_images(x, (x.shape[1] * 2, x.shape[2] * 2)))(x)
File "/home/atsushi/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 617, in call
output = self.call(inputs, **kwargs)
File "/home/atsushi/.local/lib/python2.7/site-packages/keras/layers/core.py", line 663, in call
return self.function(inputs, **arguments)
File "/home/atsushi/keras/work/keras-image-segmentation/model/fcn.py", line 111, in
x = Lambda(lambda x: tf.image.resize_images(x, (x.shape[1] * 2, x.shape[2] * 2)))(x)
File "/home/atsushi/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/ops/image_ops_impl.py", line 746, in resize_images
raise ValueError(''size' must be a 1-D int32 Tensor')
ValueError: 'size' must be a 1-D int32 Tensor

What is dataset_parser.generator?

Traceback (most recent call last):
File "train.py", line 12, in
from dataset_parser.generator import data_generator
ImportError: No module named dataset_parser.generator

What error is it?How can I solve it?

steps_per_epoch=3475?

hi,i have a question,why steps_per_epoch=3475 while not steps_per_epoch=2975 ?the number of the train datasets of cityscapes is 2975,Thank you very much and look forward to your reply

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.