Code Monkey home page Code Monkey logo

keras_unet_segmentation's Introduction

keras_unet_segmentation

This repo contains an implementation for solving a binary image segmentation problem. The repo contains training and predict code. The repo also contains code for data augmentation. Dataset must have images/labels split into two different directories.

For preproccesing and data augmentation two pixel values must be supplied pn labelled images:

  • 0 for background
  • 255 for class to segment. (Each value greater than 200 will be used as well for the class to segment)

You must run python preprocess.py --source_dir dir_where_you_have_the_original_images --label_dir dir_where_you_have_the_original_labelled_images --output_dir dir_to_write_augmented_dataset --samples number_of_total_samples_to_generate

For training you must run python train_keras_unet.py --images_dir images_dir --labels_dir labels_dir --epochs number_of_epochs_for_training --model_file file_model_name

After training you get a model file in H5 keras format (file_model_name.h5). You can use to get predictions like that: python predict_keras.py --model file_model_name.h5 --image image_to_predict

The script obtain a segmented image "pred.png" where each pixel is labelled: black for background and white for segmented class.

keras_unet_segmentation's People

Contributors

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