This repo holds the code of TransFuse: Fusing Transformers and CNNs for Medical Image Segmentation
- Pytorch>=1.6.0, <1.9.0 (>=1.1.0 should work but not tested)
- timm==0.3.2
GPUs of memory>=4G shall be sufficient for this experiment.
-
Preparing necessary data:
- downloading ISIC2017 training, validation and testing data from the official site, put the unzipped data in
./data
. - run
process.py
to preprocess all the data, which generatesdata_{train, val, test}.npy
andmask_{train, val, test}.npy
. - alternatively, the processed data is provided in Baidu Pan, pw:ymrh and Google Drive.
- downloading ISIC2017 training, validation and testing data from the official site, put the unzipped data in
-
Testing:
- downloading our trained TransFuse-S from Baidu Pan, pw:xd74 or Google Drive to
./snapshots/
. - run
test_isic.py --ckpt_path='snapshots/TransFuse-19_best.pth'
.
- downloading our trained TransFuse-S from Baidu Pan, pw:xd74 or Google Drive to
-
Training:
- downloading DeiT-small from DeiT repo to
./pretrained
. - downloading resnet-34 from timm Pytorch to
./pretrained
. - run
train_isic.py
; you may also want to change the default saving path or other hparams as well.
- downloading DeiT-small from DeiT repo to
Code of other tasks will be comming soon.
Some of the codes in this repo are borrowed from:
Please consider citing us if you find this work helpful:
@article{zhang2021transfuse,
title={TransFuse: Fusing Transformers and CNNs for Medical Image Segmentation},
author={Zhang, Yundong and Liu, Huiye and Hu, Qiang},
journal={arXiv preprint arXiv:2102.08005},
year={2021}
}
Please drop an email to [email protected]