Skip to content

ZhihaoChe/MAFF-HRNet

Repository files navigation

MAFF-HRNet

MAFF-HRNet: Multi-Attention Feature Fusion HRNet for Building Segmentation in Remote Sensing Images

This repository contains the code for the MAFF-HRNet project from this paper. At present, the program status is version 1.0, which will be further updated and improved in the future.

Environment Setup

Create and activate a virtual environment to work in, e.g. using Conda:

It is worth noting that python 3.7 and torch 1.8 are recommended.

conda create -n MAFF python=3.7
conda activate MAFF

Install the remaining requirements with pip:

pip install -r requirements.txt

Data Arrangment

├──VOC2007
     ├──ImageSets
     │      ├──Segmentation
     │      │       ├── train.txt
     │      │       ├── val.txt
     ├──SegmentationClass
     │      ├── *.png
     └──JPEGImages
            └── *.jpg

Data Preprocessing

Split Image

You may modify preprocessing.py to adapt code to cut your image.

python preprocessing.py

About Split TXT Files

The train.txt and val.txt generated by make_list.py contain a list of image names without suffix, for example:

frame_0
frame_1
frame_2
frame_3
frame_4
frame_5
frame_6
frame_7
frame_8
...

Training

  • Training with Multi-GPU.

    set distributed = True

python -m torch.distributed.launch --nproc_per_node=num_gpu train.py
  • Training with single GPU.
python train.py

Inference

python predict.py

Reference

https://github.com/bubbliiiing/unet-pytorch

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages