GithubHelp home page GithubHelp logo

baseline-main's Introduction

2D Deformable LKA

Instructions for the 2D version of the D-LKA net.

Model weights

You can download the learned weights of the D-LKA Net in the following table.

Task Dataset Learned weights
Multi organ segmentation Synapse D-LKA Net 2D
Skin 2017 Skin Dataset D-LKA Net TODO
Skin 2018 Skin Dataset D-LKA Net TODO
PH2 Skin Dataset D-LKA Net TODO

Environment Setup

  1. Create a new conda environment with python version 3.8.16:
    conda create -n "d_lka_net_2d" python=3.8.16
    conda activate d_lka_net_2d
  2. Install PyTorch and torchvision
    pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
  3. Install the requirements with:
    pip install -r requirements.txt

Synapse Dataset

Training and Testing

  1. Download the Synapse dataset from the link above.

  2. Run the code below to train D-LKA Net on the Synapse dataset.

    python train_MaxViT_deform_LKA.py --root_path ./data/Synapse/train_npz --test_path ./data/Synapse/test_vol_h5 --batch_size 20 --eval_interval 20

    --root_path [Train data path]

    --test_path [Test data path]

    --eval_interval [Evaluation epoch]

  3. Run the below code to test the D-LKA Net on the Synapse dataset.

    python test.py --volume_path ./data/Synapse/ --output_dir './model_out'

    --volume_path [Root dir of the test data]

    --output_dir [Directory of your learned weights]

Skin Dataset

Examples are given for the Skin2017 dataset. The other datasets work exactly the same.

Data Preparation

  1. Download the dataset from the link above.

  2. Prepare the data. Adjust the filespath in the preparation file accordingly.

    cd 2D/skin_code
    python Prepare_ISIC_2017.py

    The Data structure should be as follows:

    -ISIC2017
      --/data_train.npy
      --/data_test.npy
      --/data_val.npy
      --/mask_train.npy
      --/mask_test.npy
      --/mask_val.npy
    

Training and Testing

  1. Adjust the path in the train_skin_2017.py file for your paths.
  2. Run the following line of code:
    python train_skin_2017.py
  3. For evaluation follow the instruction in the jupyter notebook evaluate_skin.ipynb

baseline-main's People

Contributors

tsukorocolorlesstazaki avatar sinagho 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.