/APFormer

Primary LanguagePython

APFormer

This repo is the official implementation for:
The Lighter The Better: Rethinking Transformers in Medical Image Segmentation Through Adaptive Pruning.
(The details of our APFormer can be found at the models directory in this repo or in the paper.)

Requirements

  • python 3.6
  • pytorch 1.8.0
  • torchvision 0.9.0
  • more details please see the requirements.txt

Datasets

  • The ISIC 2018 dataset could be acquired from here.
  • The Synapse dataset could be acquired from here. The slice-level Synapse dataset preprocessed by us can be downloaded from here.
    ((The dataset partitioning of Synapse follows TransUNet and the ISIC 2018 is divided randomly.)

Training

Commands for training on the ISIC 2018 dataset

python train_ISIC.py

Commands for training on the Synapse dataset

python train_synapse.py

Testing

Commands for training on the Synapse dataset

python test.py

References

  1. vit-pytorch