diff --git a/README.md b/README.md index 53e5640..e38055a 100644 --- a/README.md +++ b/README.md @@ -33,21 +33,38 @@ MedSegDiff a Diffusion Probabilistic Model (DPM) based framework for Medical Ima ## Example Cases ### Melanoma Segmentation from Skin Images -1. Download ISIC dataset from https://challenge.isic-archive.com/data/. Your dataset folder under "data_dir" should be like: +1. Download ISIC dataset from https://challenge.isic-archive.com/data/. Your dataset folder under "data" should be like: -ISIC/ +~~~ +data +| ----ISIC +| ----Test +| | | ISBI2016_ISIC_Part1_Test_GroundTruth.csv +| | | +| | ----ISBI2016_ISIC_Part1_Test_Data +| | | ISIC_0000003.jpg +| | | ..... +| | | +| | ----ISBI2016_ISIC_Part1_Test_GroundTruth +| | ISIC_0000003_Segmentation.png +| | | ..... +| | +| ----Train +| | ISBI2016_ISIC_Part1_Training_GroundTruth.csv +| | +| ----ISBI2016_ISIC_Part1_Training_Data +| | ISIC_0000000.jpg +| | ..... +| | +| ----ISBI2016_ISIC_Part1_Training_GroundTruth +| | ISIC_0000000_Segmentation.png +| | ..... +~~~ - ISBI2016_ISIC_Part3B_Test_Data/... - - ISBI2016_ISIC_Part3B_Training_Data/... - - ISBI2016_ISIC_Part3B_Test_GroundTruth.csv - - ISBI2016_ISIC_Part3B_Training_GroundTruth.csv -2. For training, run: ``python scripts/segmentation_train.py --data_name ISIC --data_dir input data direction --out_dir output data direction --image_size 256 --num_channels 128 --class_cond False --num_res_blocks 2 --num_heads 1 --learn_sigma True --use_scale_shift_norm False --attention_resolutions 16 --diffusion_steps 1000 --noise_schedule linear --rescale_learned_sigmas False --rescale_timesteps False --lr 1e-4 --batch_size 8`` - -3. For sampling, run: ``python scripts/segmentation_sample.py --data_name ISIC --data_dir input data direction --out_dir output data direction --model_path saved model --image_size 256 --num_channels 128 --class_cond False --num_res_blocks 2 --num_heads 1 --learn_sigma True --use_scale_shift_norm False --attention_resolutions 16 --diffusion_steps 1000 --noise_schedule linear --rescale_learned_sigmas False --rescale_timesteps False --num_ensemble 5`` +2. For training, run: ``python scripts/segmentation_train.py --data_name ISIC --data_dir *input data direction* --out_dir *output data direction* --image_size 256 --num_channels 128 --class_cond False --num_res_blocks 2 --num_heads 1 --learn_sigma True --use_scale_shift_norm False --attention_resolutions 16 --diffusion_steps 1000 --noise_schedule linear --rescale_learned_sigmas False --rescale_timesteps False --lr 1e-4 --batch_size 8`` + +3. For sampling, run: ``python scripts/segmentation_sample.py --data_name ISIC --data_dir *input data direction* --out_dir *output data direction* --model_path *saved model* --image_size 256 --num_channels 128 --class_cond False --num_res_blocks 2 --num_heads 1 --learn_sigma True --use_scale_shift_norm False --attention_resolutions 16 --diffusion_steps 1000 --noise_schedule linear --rescale_learned_sigmas False --rescale_timesteps False --num_ensemble 5`` 4. For evaluation, run ``python scripts/segmentation_env.py --inp_pth *folder you save prediction images* --out_pth *folder you save ground truth images*``