Instructions for the 2D version of the D-LKA net.
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 |
- 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
- 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
- Install the requirements with:
pip install -r requirements.txt
-
Download the Synapse dataset from the link above.
-
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]
-
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]
Examples are given for the Skin2017 dataset. The other datasets work exactly the same.
-
Download the dataset from the link above.
-
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
- Adjust the path in the train_skin_2017.py file for your paths.
- Run the following line of code:
python train_skin_2017.py
- For evaluation follow the instruction in the jupyter notebook evaluate_skin.ipynb