This repository is for the paper "Multi-Granularity Aggregation Network for Remote Sensing Few-Shot Segmentation"
git clone https://github.com/sfengpeng/MGANet.git
cd MGANet
conda create -n MGANet python=3.9
conda activate MGANet
pip install -r requirements.txt
Download the datasets from here and the put them in the data directory.
MGANet
└─data
└─iSAID
├─ train
├─ val
└─LoveDA
├─ train
├─ val
Download the ImageNet pretrained backbone from here and put them in the pretrained_model directory.
MGANet
└─pretrained_model
├─ resnet50_v2.pth
├─ ....
We also provide the trained models weights for evaluation. vgg16, resnet50, resnet101, Non-BAM.
You need to pre-configure the script file with settings such as GPU, backbone network, and other parameters., and run the following code for training and testing:
bash train.sh
bash test.sh
To switch to the non-BAM setting, simply copy the contents of dataset-BAM.py
and replace the existing dataset.py
MGANet
└─utils
├─ dataset.py
├─ dataset-BAM.py
This repository is built upon the foundations of MSANet, Slot Attention, and DMNet. We are very grateful for their work!