Coder Social home page Coder Social logo

segmentation_with_convex_prior's Introduction

Scribble-based Image Segmentation with Convexity Prior

Introduction

simple architecture for segmenting convex objects in images using user-provided scribbles. The proposed approach involves a primary model to segment pixels into foreground and background regions. The primary model’s output is subsequently passed to a Convex network, which refines the foreground pixels to adhere to the convexity prior, assuming smooth and continuous boundaries without concave regions. The architecture achieves memory efficiency and does not require training on a vast number of images, making it suitable for practical applications with limited computational resources. This has been accomplished using two approaches: • Approach 1: Generating the convex segmented image using a fully connected network and convex network architecture. • Approach 2: Generating the convex segmented image using a pre-trained segmentation network and convex network architecture.

Requirements

See requirements.txt file

Setup

  1. Install PyTorch and other required Python libraries in a virtual environment with:

    pip install -r requirements.txt
    
  2. Collect Data:

    Foreground and background scribbles are to be made on Images that need to be segmented. Save them in the data folder.

    For example, data floder contains the folder single_apple which contains the input image, scribble_fg and scribble_bg.

    All the data to be stored in a similar way.

Usage

python main.py executes and runs the code with all the default arguments.

For changing the default arguments follow the below instructions:

  1. Input: Folder of the image which needs to be segmented to be proved here.

    python main.py --inputpath data/single_apple/

  2. Primary model selection:

    Neural net as a primary model: python main.py -pm neuralnet

    Segmentation net as a primary model: python main.py -pm segmentationnet

  3. Primary model parameters:

    Batch size, epochs, learning rate, and hidden units are some of the neural net parameters that can be altered through command line.

    python main.py -pm neuralnet -nnbs 64 -nne 100 -nnlr 0.00001 -nnhu 256

    Batch size, epochs, learning rate are some of the segmentation net parameters that can be altered through command line. python main.py -pm segmentationnet -snbs 64 -sne 100 -snlr 0.0001

  4. Convex net parameters:

    Batch size, epochs, learning rate, hidden units are some of the convex net parameters that can be altered through command line.

    python main.py -pm neuralnet -nnbs 64 -nne 100 -nnlr 0.00001 -nnhu 256 -cnbs 64 -cne 50 -cnlr 0.00001 -cnhu 256 python main.py -pm segmentationnet -snbs 64 -sne 100 -snlr 0.0001 -cnbs 64 -cne 50 -cnlr 0.00001 -cnhu 256

Outputs

The output of the network is saved in repective data folder. Output contains result.png, model configurations, terminal output and logs of tensorboard.

segmentation_with_convex_prior's People

Contributors

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