Code Monkey home page Code Monkey logo

semantic-segmentation-keras-per-divam-gupta-with-kmean-clusters-as-presented-by-vidhya's Introduction

Basic-image-segmentation-keras-with-kMean-clusters-as-pesented-by-Vidhya

kMean clusters from Vidhya used for final labeling of segments. This repository is based on the repository of Divam Gupta.

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 help to a novice such as myself.

Original Photo

The following is the original photo that we are working from found in "sample_images/1_input.jpg":

Image

Use of Pre-Trained Models

We use the pre-trained code provided by Divam to create our segmentation of this bedroom image using the python load_pretrain_and_create_image.py program driven with a command line from an xterm.

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

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

kMean Clustering

We then use the python program interactive_plots_clusters_with_box.py to created dscrete clusters segmentations using kMean as presented by Vidhya.

  kmeans = KMeans(n_clusters=20, random_state=0).fit(pic_n)

  pic2show = kmeans.cluster_centers_[kmeans.labels_]

The program is then used to discriminate the various predicted clusters and isolate on the segmented item that we are trying to isloate.

Image

Interactive Program to Determine Value for Feature to be Isolated and Box it in

We made our initial segmentation working with the the bedroom picture under the sample_images subdirectory (1_input.jpg). After discriminating all of the major features in the provided image as shown above, we then isolate the picture (bed) as our key feature, and then create a subsequent image showing just that feature with a green rectangle around it.

Image

Noise Associated with Segment Value Thresholding

This second repository is similar to another Keras application repository found in this GitHub except that we are be using the kMean clusters to finalize our image segmentation process as presented by Vidhya. By using this kMean method we can reduce some noise found with just pixel value thresholds for the segmentation. sometimes the bed pixel values can also be found in the transitions from one segment to the next. kMean appears to reduce this noise.

Image

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

semantic-segmentation-keras-per-divam-gupta-with-kmean-clusters-as-presented-by-vidhya's People

Contributors

philliec459 avatar

Stargazers

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