GithubHelp home page GithubHelp logo

vesiclesegmentation's Introduction

2D Vesicle Instance Segmentation

Main framework of training and inference code comes from C-3-Framework. The original liscense is included under ./liscense

Environment

  • Follow C-3-Framework
    • Python 3.x
    • Pytorch 1.0 (some networks only support 0.4): http://pytorch.org .
    • other libs in requirements.txt, run pip install -r requirements.txt.
    • Perhaps some packages like h5py need to be installed after above command. pip install h5py

Data Preparation

  • cd ./data
  • Modify settings in ./data/config.py
  • Run python 0_augment.py to do augmentation manually.
  • Run python 1_data_prepared.py to split sugmented data into train, valid, test datasets.

Training

  • Modify settings in ./training/config.py
  • cd ./training
  • python train.py
  • Results will be stored at ./training/exp/. Tensorboard can be used to visualize the result by tensorboard --logdir=exp --port=6006

Pretrained Model

  • Pretrained model can be obtained from google drive
  • Download to default position at ./model

Inference

cd ./inference

  1. Synapse locations to input images and masks.
    • By python 0_synapse_gen.py
    • Output to OUTPUT_DIR defined in ./code/config.py, including:
      • dir full: full input image
      • dir part: masked input image (not used)
      • dir mask: binary mask
  2. Use trained model to predict the heat map.
    • By python 1_test_all.py.
    • Predict with MODEL_DIR/MODEL_NAME directed by ./code/config.py. Output to OUTPUT_DIR/result, including:
      • dir pred: heat map in npy format
      • dir mask: predicted mask by 0.3 threshold
      • dir gt: empty
  3. Multiply the predicted mask and heat map with input mask.
    • By python 2_multiply.py
    • Output to OUTPUT_DIR/mask_result, including:
      • dir pred: heat map in npy format
      • dir mask: predicted binary mask by 0.3 threshold.
  4. Use watershed to cut heat map into vesicles. (Two-step Watershed)
    • By python 3_post_process.py
    • Output to OUTPUT_DIR/wshed_result, including:
      • dir data: segmentations in npy format
      • dir img: matplotlib images of segmentation result
  5. Analyze the final 3D bounding box of synapse seg and prepare to display in VAST.
    • By python 4_final_step.py
    • Output to OUTPUT_DIR/vast_volume

vesiclesegmentation's People

Contributors

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