Remote sensing image plays an irreplaceable role in fields such as agriculture, water resources, military, and disaster relief. Pixel-level interpretation is a critical aspect of remote sensing image applications; however, a prevalent limitation remains the need for extensive manual annotation. For this, we try to introduce open-vocabulary semantic segmentation (OVSS) into the remote sensing context. However, due to the sensitivity of remote sensing images to low-resolution features, distorted target shapes and ill-fitting boundaries are exhibited in the prediction mask. To tackle this issue, we propose a simple and general upsampler, SimFeatUp, to restore lost spatial information in deep features in a training-free style. Further, based on the observation of the abnormal response of local patch tokens to [CLS] token in CLIP, we propose to execute a straightforward subtraction operation to alleviate the global bias in patch tokens. Extensive experiments are conducted on 17 remote sensing datasets spanning semantic segmentation, building extraction, road detection, and flood detection tasks. Our method achieves an average of 5.8%, 8.2%, 4%, and 15.3% improvement over state-of-the-art methods on 4 tasks. All codes are released.
# 1. install SimFeatUp
# refer to https://github.com/likyoo/SimFeatUp
# 2. git clone this repository
git clone https://github.com/likyoo/SegEarth-OV.git
cd SegEarth-OV
# 3. create new anaconda env
conda create -n SegEarth python=3.9
conda activate SegEarth
# install torch and dependencies
pip install -r requirements.txt
# The dependent versions are not strict, and in general you only need to pay attention to mmcv and mmsegmentation.
We include the following dataset configurations in this repo:
Semantic Segmentation
: OpenEarthMap, LoveDA, iSAID, Potsdam, Vaihingen, UAVidimg, UDD5, VDDBuilding Extraction
: WHUAerial, WHUSat.Ⅱ, Inria, xBDpreRoad Extraction
: CHN6-CUG, DeepGlobe, Massachusetts, SpaceNetWater Extraction
: WBS-SI
Please refer to dataset_prepare.md for dataset preparation.
python demo.py
Single-GPU:
python eval.py --config ./configs/cfg_DATASET.py --workdir YOUR_WORK_DIR
Multi-GPU:
bash ./dist_test.sh ./config/cfg_DATASET.py
Evaluation on all datasets:
python eval_all.py
Results will be saved in results.xlsx
.
@article{li2024segearth,
title={SegEarth-OV: Towards Training-Free Open-Vocabulary Segmentation for Remote Sensing Images},
author={Li, Kaiyu and Liu, ruixun and Cao, Xiangyong and Bai, Xueru and Zhou, Feng and Meng, Deyu and Wang, Zhi},
journal={arXiv preprint arXiv:2410.01768},
year={2024}
}
This implementation is based on ClearCLIP and FeatUp. Thanks for the awesome work.