Giter Site home page Giter Site logo

faz-segmentation's Introduction

FAZ-Segmentation

Combine Hessian Filter and UNet for Foveal Avascular Zone Extraction picture

Docker Installation for FLask App

  1. Build and run docker on port 2001
$ ./docker-build.sh

If getting error in permission

$ chmod u+x ./docker-build.sh

  1. I have already mounted /images to /images of docker, so to test we will prepare image in:
├   ├── images
|       ├── raw
|           ├── 1.tif
|       ├── predict
|           ├── 1.png
  • We will put raw image in /images/raw
  • In postman:
  • You will have the prediction of model at /images/predict

picture

Training process

Prepare dataset folder

├── train
|   ├── raw 
|       ├── image1.tif
|       ├── ...
|   ├── mask
|       ├── image1.png
|       ├── ...
├── valid
|   ├── raw 
|       ├── image1.png
|       ├── ...
|   ├── mask
|       ├── image1.png
|       ├── ...
├── test
|   ├── raw 
|       ├── image1.tif
|       ├── ...
|   ├── mask
|       ├── image1.png
|       ├── ...

Setup Environment

Run this script to create a virtual environment and install dependency libraries

  1. $conda create -n name_environment python=3.6
  2. $conda activate name_environment
  3. $pip install -r requirements-2.txt

To train this project, we just run the command

$python train.py

where train_config.json which is located in config folder

We need to adjust the parameter in this json file before training:

  • net_type: name of pretrained model you want to train. list of model: efficentnet_b0, efficientnet_b1, efficientnet_b2, efficientnet_b3, efficientnet_b4, efficientnet_b5, Se_resnext50, Se_resnext101, Se_resnet50, se_resnet101, Se_resnet152, Resnet18, Resnet34,Resnet50, Resnet101

  • pretrained: boolean, using pretrained weights from ImageNet

  • weight_path: Weight path of old trained model

  • train_folder : path of raw folder of training dataset example: /home/vinhng/OCTA/preprocess_OCTA/train/raw

  • valid_folder : path of raw folder of valid dataset example: /home/vinhng/OCTA/preprocess_OCTA/valid/raw

  • test_folder : path of raw folder of valid dataset example: /home/vinhng/OCTA/preprocess_OCTA/test/raw

  • classes: number of classes. Default = 1

  • model_path: directory which contains trained model

  • size: size of input image and mask

  • thresh_hold: thresh hold for convert grayscale mask to binary mask

  • epoch: number of training epoch

Testing process

download weight of model: 
https://storage.googleapis.com/v-project/Se_resnext50-920eef84.pth

Then move this weight in folder: 
./models
python test.py --path_images --model_type --weight 
  • path_images: directory of raw folder in testset (see prepare dataset above)
  • model_type: name of pretrained model you want to train. Default: Se_resnext50

List of pretrained model is at training process above

  • weight: directory to weight path.

faz-segmentation's People

Contributors

vinhnguyen21 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar Sarath avatar  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.