Git Product home page Git Product logo

denseinferencewrapper's Introduction

Dense Inference Wrapper

Overview

An add-on to Krähenbühls DenseCRF for 3d grayscale image volumes and a corresponding python wrapper to handle numpy ndarrays.

It was designed and tested to sharpen soft-labeled classifier outputs for medical 3d image data, such as CT-volumes.

The wrapper makes it very easy to run Krähenbühls super fast DenseCRF on your classifier output (i.e. the output of your fully convolutional neural network) just by a single python method call.

DenseCRF denseinference/lib

The CRF-code is modified from the publicly available code by Philipp Krähenbühl and Vladlen Koltun. See their project website for more information.

If you also use this code, please cite their paper: Efficient Inference in Fully Connected CRFs with Gaussian Edge Potentials, Philipp Krähenbühl and Vladlen Koltun, NIPS 2011.

The modification is also inspired by DeepLab and its application of DenseCRF. See their project website for more information.

Setup

Requirements

make, g++, boost-python

Requirements Python

numpy, psutil

Requirements Python Testing

matplotlib

Installation

cd denseinferencewrapper
make all
sudo pip install .

Usage

from denseinference import CRFProcessor

# init wrapper object
# all crf options can be set here (optional)
pro = CRFProcessor.CRF3DProcessor()

param max_iterations: maximum crf iterations param pos_x_std: DenseCRF Param (float) (3) param pos_y_std: DenseCRF Param (float) (3) param pos_z_std: DenseCRF Param (float) (3) param pos_w: DenseCRF Param (float) (3) param bilateral_x_std: DenseCRF Param (float) (60) param bilateral_y_std: DenseCRF Param (float) (60) param bilateral_z_std: DenseCRF Param (float) (60) param bilateral_intensity_std: DenseCRF Param (float) (20) param bilateral_w: DenseCRF Param (float) (10) param dynamic_z: Auto adjust z-params by image shape (bool) (False) param ignore_memory: If true, images requiring to much memory are skipped (bool) (False) param verbose: Print lot's of status information (bool) (False)

# Now run crf and get hard labeled result tensor:
result = pro.set_data_and_run(img, feature_tensor)

param img: Normalized input as ndarray. (W, H, D), [0, 1] param label: Continuous label tensor as ndarray. (W, H, D, L), [0, 1] return: Hard labeled result as ndarray. (W, H, D), [0, L], dtype=int16

denseinferencewrapper's People

Contributors

mbickel avatar

Stargazers

Patrick Christ avatar

Watchers

 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.