Giter Club home page Giter Club logo

keras-semantic-segmentation-example's Introduction

keras-semantic-segmentation-example

Example of semantic segmentation in Keras

Single class example:

Generated data: random ellipse with random color on random color background and with random noise added.

Result: 1st images is input image, 2nd image is ground truth mask, 3rd image is probability, 4th image is probability thresholded at 0.5. alt tag

Multi-class example:

Generated data: first class is random ellipse with random color and second class is random rectangle with random color on random color background and with random noise added.

Result: 1st images is input image, 2nd image is ground truth mask, 3rd image is probability, 4th image is probability thresholded at 0.5. alt tag

keras-semantic-segmentation-example's People

Contributors

mrgloom 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

keras-semantic-segmentation-example's Issues

Failures if image width != height

In binary_crossentropy_example.py if I change the dimensions of the image so that the width and height are not the same, as in:

IMAGE_W = 126
IMAGE_H = 124

then I get the error:

Epoch 1/100000
Traceback (most recent call last):
File "binary_crossentropy_example.py", line 187, in <module>  train()
File "binary_crossentropy_example.py", line 182, in train callbacks=callbacks)
File "C:\Python3.6\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "C:\Python3.6\lib\site-packages\keras\engine\training.py", line 2230, in fit_generator
class_weight=class_weight)
File "C:\Python3.6\lib\site-packages\keras\engine\training.py", line 1877, in train_on_batch
class_weight=class_weight)
File "C:\Python3.6\lib\site-packages\keras\engine\training.py", line 1480, in _standardize_user_data
exception_prefix='target')
File "C:\Python3.6\lib\site-packages\keras\engine\training.py", line 123, in _standardize_input_data
str(data_shape))
ValueError: Error when checking target: expected activation_1 to have shape (9216, 1) but got array 
with shape (15624, 1)

On Windows 10
Keras 2.1.6
tensorflow 1.8.0

Reshaping the mask

Sorry for the interruption, but I don't understand why the mask is reshaped in binary_crossentropy_example.py, line 106:

mask_list= mask_list.reshape(batch_size,IMAGE_H*IMAGE_W,NUMBER_OF_CLASSES)

but the image_list is not similarly reshaped. The code works perfectly as is, but I'm just trying to understand why the above line isn't:

mask_list= mask_list.reshape(batch_size,IMAGE_H,IMAGE_W,NUMBER_OF_CLASSES)

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.