Git Product home page Git Product logo

basic-semantic-segmentation-keras-per-work-of-divam-gupta's Introduction

Image-Segmentation-using-Keras-Segmentation-per-the-work-of-Divam-Gupta

This repository initially came from Divam Gupta's GitHub repository on Image Segmentation using Keras:

https://github.com/divamgupta/image-segmentation-keras

This repository is based on studying Divam Gupta's GitHub repository, blog and other written materials that we have found online. This is great work and a real resource to a novice such as myself. we will be creating a few repositories using our interpretation of how this all might be implemented. We might be wrong, so any constructive criticism is welcome.

Original Photo

This first repository will be based on using Divam Gupta's pre-trained examples shown in his Readme file. This is the original photo that we are working from:

Image

Pre-Trained Models

We use the pre-trained code to create segmentation items from the above photo using load_pretrain_and_create_image.py driven from an xterm. The following pre-pretrain models are available, but we have found the pspnet_50_ADE_20K to work the best in this instance.

model = pspnet_50_ADE_20K() # in between detail - load the pretrained model trained on ADE20k dataset

#model = pspnet_101_cityscapes() # too much detail - load the pretrained model trained on Cityscapes dataset

#model = pspnet_101_voc12() # Just the People - load the pretrained model trained on Pascal VOC 2012 dataset

Segment Predictions

Our pre-trained model prediction is made with just a few lines of code shown below,

out = model.predict_segmentation(
    inp="sample_images/1_input.jpg",
    out_fname="bed_out.png"
)

and the following image is the predicted image segmentation from the original bedroom photo shown above.

Image

Interactive Program to Identify Segmented Features

To determine the segment or item(s) values that we want to isolate, we interactively scan the photo taking note of the pixel values associated with the segments in the photograph that we are trying to isolate. The python program for this program is interactive_plots_with_box.py. As can be seen below, the bed has a value of 61 and the rug has a value of 80.

Image

In this instance we only label the segment for the bed or value 61.

label = np.zeros(data.shape )
label[data ==61]  = 61 #bed

We are working with a bedroom picture under the sample_images subdirectory (1_input.jpg). After discriminating all of the major features in the photo as shown above, we can then isolate a particular item in the picture (bed), and create a subsequent image showing just that feature with a green rectangle around it.

Image

We are working in Ubuntu and each python program is driven from an xterm command line using 'python xxxx.py' as the command.

basic-semantic-segmentation-keras-per-work-of-divam-gupta's People

Contributors

philliec459 avatar

Watchers

 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.