README.md

April 15, 2025 · View on GitHub

ROS-SAM: High-Quality Interactive Segmentation for Remote Sensing Moving Object (ROS-SAM)

ROS-SAM: High-Quality Interactive Segmentation for Remote Sensing Moving Object
CVPR 2025

We propose ROS-SAM to extend SAM for high-quality remote moving object segmentation. Refer to our paper for more details.

Quick start

git clone https://github.com/ShanZard/ROS-SAM.git
cd  ROS-SAM
conda create -f environment.yml 

Prepare your dataset

Preparing this dataset is a complex process.

(1). Download the SAT-MTB dataset at this link.
(2). Prepare the dataset format according to the setting of ROSSAM_Dataset. The most important thing is that you need to prepare a boxes.npy [N,4] [xmin,ymin,xmax,ymax] and onehotmask.npy [N,H,W] for each image.
(3). Follow the example of the data folder and put in the corresponding file. data\train have a example.

Model checkpoints

Our model is based on SAM and HQ-SAM, and all checkpoints can be downloaded from HQ-SAM.
With the L version, for example, you need to do the following.
mkdir pretrained_checkpoint
download sam_vit_l_0b3195.pth\sam_vit_l_maskdecoder.pth\sam_hq_vit_l.pth

Change some code

mmcv.impad does not support multi-channel padding, so some modifications need to be made to its source code to support padding for onohotmask. This is very simple, and of course we provide a referential impad in modifiedimpad.py

Training and inference

cd train    
accelerate launch train.py  
CUDA_VISIBLE_DEVICES=0 accelerate launch inference.py 

Notably, the inference process only works on a single GPU.

Citation

If you find ROS-SAM useful in your research or refer to the provided baseline results, please star ⭐ this repository and consider citing

@inproceedings{rossam,
    title={ROS-SAM: High-Quality Interactive Segmentation for Remote Sensing Moving Object},
    author={Shan, Zhe and Liu, Yang and Zhou, Lei and Yan, Cheng and Wang, Heng and Xie, Xia},
    booktitle={CVPR},
    year={2025}
}  

Acknowledgments