Skip to content
/ ALPS Public

ALPS: An Auto-Labeling and Pre-training Scheme for Remote Sensing Segmentation With Segment Anything Model

Notifications You must be signed in to change notification settings

StriveZs/ALPS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ALPS

This is the offical implement of our ALPS framwork.

Paper: "ALPS: An Auto-Labeling and Pre-training Scheme for Remote Sensing Segmentation With Segment Anything Model"

Paper Link

Usage

Environment

  • Python 3.8.5
  • Pytorch 1.12.1+cu113
  • Torchvision 0.13.1+cu113
  • Torchaudio 0.12.1+cu113
  • scikit-learn 1.3.2
  • segment-anything 1.0

Install Segment Anything:

git clone [email protected]:facebookresearch/segment-anything.git
cd segment-anything; pip install -e .

Click the links below to download the checkpoint for the corresponding model type.

Getting Started

  1. Follow the structure below to organize the dataset:
├──dataset_path
│   ├── img_dir
│   │   ├── train
│   │   │   ├── xxx{img_suffix}
│   │   │   ├── yyy{img_suffix}
│   │   │   ├── zzz{img_suffix}
│   │   │   ├── ....
│   │   ├── val
│   │   │   ├── xxx{img_suffix}
│   │   │   ├── yyy{img_suffix}
│   │   │   ├── zzz{img_suffix}
│   │   │   ├── ....
│   │   ├── test
│   │   │   ├── xxx{img_suffix}
│   │   │   ├── yyy{img_suffix}
│   │   │   ├── zzz{img_suffix}
│   │   │   ├── ....
  1. First, download the pre-trained SAM model checkpoint. Then, you can use the command line below to perform automatic labeling on your own datasets:
python main.py --root_dir .../dataset_path --image_suffix .png --sam_checkpoint .../sam_vit_h_4b8939.pth --model_type vit_h --number_clusters xx --vis True
  1. Additionally, our framework supports more customized parameter settings:
  • 'process_list': This can be set to ‘train’, ‘val’, or ‘test’.
  • 'threshold': This is the area size threshold used in the filtering gate module.
  • 'label_dir': This is the path where the pseudo-labels are saved.
  • 'device': This can be set to ‘cuda’ or ‘cpu’.
  • 'batch_size': This is the batch size used in online K-means.
  • More parameter settings can be found in the main.py file.

About

ALPS: An Auto-Labeling and Pre-training Scheme for Remote Sensing Segmentation With Segment Anything Model

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages