This Project is base on Pytorch and Pytorch-Lightning and focus on Medical Image Segmentation
First, install dependencies
# clone project
git clone https://github.com/t110368027/Medical_Segmentation_Benchmark
# install project
cd Medical_Segmentation_Benchmark
pip install -e .
pip install -r requirements.txt
Next, navigate to any file and run it.
# run module
python train.py -m MODEL -dn DATASET_NAME
## MODEL UNet, NestedUNet, UNet_3Plus, AttU_Net, R2AttU_Net, and so on
## DATASET_NAME CHUAC, DCA1, STARE, CHASEDB1
Before run this project you need to download the dataset :
./Medical_Segmentation_Benchmark/
├── data/
│ ├─angiography
│ │ ├─Hemotool
│ │ │ └─angio1.png_mask.png
│ │ ├─Original
│ │ │ └─1.png
│ │ └─Photoshop
│ │ └─angio1ok.png
│ ├─CHASE_DB1
│ │ ├─Images
│ │ │ └─Image_01L.jpg
│ │ └─Masks
│ │ └─Image_01L_1stHO.png
│ ├─DB_Angiograms_134
│ │ ├─Database_134_Angiograms
│ │ │ ├─1.pgm
│ │ │ ├─1_gt.pgm
│ ├─STARE
│ │ ├─imgs
│ │ │ └─im0001.png
│ │ └─label-ah
│ └─im0001.ah.png
├── datasets/
│ ├─CHASEDB1
│ │ └─set.npz
│ ├─CHUAC
│ │ └─set.npz
│ ├─DCA1
│ │ └─set.npz
│ └─STARE
│ └─set.npz
├── README.md
└── train.py
Choose a path to create a folder with the dataset name and download datasets
Follow data structure tree before.
Then run preprocess.py
convert .jpg
, .png
or .pgm
to numpy array and save it to .npz
file
# run module
python preprocess.py -dp DATASET_PATH -dn DATASET_NAME
## DATASET_PATH ./data
## DATASET_NAME CHUAC, DCA1, STARE, CHASEDB1
@misc{Medical_Segmentation_Benchmark,
author = {Jia-Ming Hou},
title = {{Medical_Segmentation_Benchmark}},
year = {2023},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/t110368027/Medical_Segmentation_Benchmark}},
version = {0.0.1},
}
Project is distributed under Apache 2.0