Code Monkey home page Code Monkey logo

unet's Introduction

Keras U-Net

What is it?

Keras implementation of a 2D/3D U-Net with the following implementations provided:

Usage

Dependencies

This repository depends on the following libraries:

  • Tensorflow
  • Keras
  • Python 3
  • Numpy
  • Matplotlib

Building your network

The pre-implemented layers are available in layers3D.py. Use the layers to build your preferred network configuration in network.py

Example
from layers3D import *
from tensorflow.keras.models import Model

def network(input_img, n_filters=16, dropout=0.5, batchnorm=True):
    outputs = inception_block(input_img, n_filters=n_filters, batchnorm=batchnorm, strides=1, recurrent=2)
    model = Model(inputs=[input_img], outputs=[outputs])
    return model

Refer to network.py for a full example

Data Generator

Rewrite the __data_generation() method in datagenerator.py to supply batches of data during training

Example
def __data_generation(self, list_IDs_temp):

        X = np.empty((self.batch_size, *self.dim, self.n_channels))
        y = np.empty((self.batch_size, *self.dim, self.n_channels))

        for i, ID in enumerate(list_IDs_temp):
            # Write logic for selecting/manipulating X and y here
            X[i,] = np.load('path/to/x/ID')
            y[i,] = np.load('path/to/y/ID')

        return X, y

The DataGenerator class in train.py takes in list arguments containing the ID (filenames) of X and y

Hyperparameters

Set the appropriate values for the hyper-parameters listed in hyperparameters.py

Train

Run train.py once all the configuration is done to train your network

Testing

Run evaluate.py or predict.py with the appropriate list_IDs provided to the DataGenerator

unet's People

Contributors

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