Giter VIP home page Giter VIP logo

sam-cd's Introduction

SAM-CD

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

alt text

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

2024-4-30 Update:

SAM-CD now supports access to efficientSAM. Check the updated model at models/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 in SAM-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}
}

sam-cd's People

Contributors

ggsding avatar huili-1221 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.