Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pytorch code of the SAM-CD

NotificationsYou must be signed in to change notification settings

DingLei14/SAM-CD

Repository files navigation

Pytorch codes ofAdapting Segment Anything Model for Change Detection in HR Remote Sensing Images [paper]

alt text

The SAM-CD adoptsFastSAM as the visual encoder with some modifications.

2024-4-30 Update:

SAM-CD now supports access toefficientSAM. Check the updated model atmodels/effSAM_CD.py (prior installation of efficientSAM at the project folder is required). However, direct integration of efficientSAM may cause an accuracy drop, so there is space to further improve the SAM-CD architecture.

How to Use

  1. Installation

  2. Dataset preparation.

    • Please split the data into training, validation and test sets and organize them as follows:
      YOUR_DATA_DIR      ├── ...      ├── train      │   ├── A      │   ├── B      │   ├── label      ├── val      │   ├── A      │   ├── B      │   ├── label      ├── test      │   ├── A      │   ├── B      │   ├── label
  • Find change line 13 inSAM-CD/datasets/Levir_CD.py (or other data-loading .py files), change/YOUR_DATA_ROOT/ to your local dataset directory.
  1. Training

    classic CD training:python train_CD.py

    training CD with the proposed task-agnostic semantic learning:python train_SAM_CD.py

    line 16-45 are the major training args, which can be changed to load different datasets, models and adjust the training settings.

  2. Inference and evaluation

    inference on test sets: set the chkpt_path and run

    python pred_CD.py

    evaluation of accuracy: set the prediction dir and GT dir, and run

    python eval_CD.py

(More details to be added...)

Dataset Download

In the following, we summarize links to some frequently used CD datasets:

Pretrained Models

For readers to easily evaluate the accuracy, we provide the trained weights of the SAM-CD.

Drive
Baidu (pswd: SMCD)

Cite SAM-CD

If you find this work useful or interesting, please consider citing the following BibTeX entry.

@article{ding2024adapting,title={Adapting Segment Anything Model for Change Detection in HR Remote Sensing Images},author={Ding, Lei and Zhu, Kun and Peng, Daifeng and Tang, Hao and Yang, Kuiwu and Bruzzone, Lorenzo},journal={IEEE Transactions on Geoscience and Remote Sensing}, year={2024},volume={62},pages={1-11},doi={10.1109/TGRS.2024.3368168}}

About

Pytorch code of the SAM-CD

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp