YAML Metadata
Warning:
empty or missing yaml metadata in repo card
(https://huggingface.co/docs/hub/model-cards#model-card-metadata)
Requirements
🛠️Environment
- Python 3.8+
- PyTorch 2.0.1+
- CUDA 11.8+
- Ubuntu 22.04 or higher / Windows 10
🛠️Installation
conda create --name rscd python=3.8
conda activate rscd
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.8 -c pytorch -c nvidia
pip install pytorch-lightning==2.0.5
pip install scikit-image==0.19.3 numpy==1.24.4
pip install torchmetrics==1.0.1
pip install -U catalyst==20.09
pip install albumentations==1.3.1
pip install einops==0.6.1
pip install timm==0.6.7
pip install addict==2.4.0
pip install soundfile==0.12.1
pip install ttach==0.0.3
pip install prettytable==3.8.0
pip install -U openmim
pip install triton==2.0.0
mim install mmcv
pip install -U fvcore
cd rscd/models/backbones/lib_mamba/kernels/selective_scan && pip install .
📁Dataset Preparation
We evaluate our method on three public datasets: LEVIR-CD, WHU-CD, and CLCD.
Please organize the datasets as follows:
rschangedetection
├── rscd (code)
├── work_dirs (save the model weights and training logs)
│ └─CLCD_BS4_epoch200 (dataset)
│ └─stnet (model)
│ └─version_0 (version)
│ │ └─ckpts
│ │ ├─test (the best ckpts in test set)
│ │ └─val (the best ckpts in validation set)
│ ├─log (tensorboard logs)
│ ├─train_metrics.txt (train & val results per epoch)
│ ├─test_metrics_max.txt (the best test results)
│ └─test_metrics_rest.txt (other test results)
└── data
├── LEVIR_CD
│ ├── train
│ │ ├── A
│ │ │ └── images1.png
│ │ ├── B
│ │ │ └── images2.png
│ │ └── label
│ │ └── label.png
│ ├── val (the same with train)
│ └── test(the same with train)
├── WHU_CD
│ ├── train
│ │ ├── image1
│ │ │ └── images1.png
│ │ ├── image2
│ │ │ └── images2.png
│ │ └── label
│ │ └── label.png
│ ├── val (the same with train)
│ └── test(the same with train)
└── CLCD (the same with WHU_CD)
🚀Use example
Training
python train.py -c configs/mamba_cttf.py
Testing
python test.py \
-c configs/mamba_cttf.py \
--ckpt work_dirs/CLCD_BS4_epoch200/mamba_cttf/version_0/ckpts/test/epoch=156.ckpt \
--output_dir work_dirs/CLCD_BS4_epoch200/mamba_cttf/version_0/ckpts/test \
Count params and flops
python tools/params_flops.py --size 256
💡Acknowledgement
Thanks to previous open-sourced repo:
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support