CAFNet applies circular attention mechanisms to enhance the segmentation of medical images.
- Ensure all dependencies in
requirements.txt
are met. It is recommended to create a virtual environment using therequirements.txt
.
- Download the original dataset and extract it to the
./data
folder. - Run
random.division.py
to randomly split the dataset into training, validation, and test sets. - Execute
process.py
to preprocess all data. This will generatedata_{train, val, test}.npy
andmask_{train, val, test}.npy
.
- Download the DeiT-base model from the DeiT repository and save it to the
./pretrained
folder. - Download the ResNet-34 model from the timm PyTorch repository and save it to the
./pretrained
folder. - Run
train.py
. You may need to adjust some parameters based on your specific settings.
- Run
test.py
with the following command:python test.py --ckpt_path='path_to_your_check_point.pth