Update README.md
Browse files
README.md
CHANGED
|
@@ -9,25 +9,90 @@
|
|
| 9 |
|
| 10 |
### Installation
|
| 11 |
```bash
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
### Installation
|
| 11 |
```bash
|
| 12 |
+
conda create --name rscd python=3.8
|
| 13 |
+
conda activate rscd
|
| 14 |
+
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.8 -c pytorch -c nvidia
|
| 15 |
+
pip install pytorch-lightning==2.0.5
|
| 16 |
+
pip install scikit-image==0.19.3 numpy==1.24.4
|
| 17 |
+
pip install torchmetrics==1.0.1
|
| 18 |
+
pip install -U catalyst==20.09
|
| 19 |
+
pip install albumentations==1.3.1
|
| 20 |
+
pip install einops==0.6.1
|
| 21 |
+
pip install timm==0.6.7
|
| 22 |
+
pip install addict==2.4.0
|
| 23 |
+
pip install soundfile==0.12.1
|
| 24 |
+
pip install ttach==0.0.3
|
| 25 |
+
pip install prettytable==3.8.0
|
| 26 |
+
pip install -U openmim
|
| 27 |
+
pip install triton==2.0.0
|
| 28 |
+
mim install mmcv
|
| 29 |
+
pip install -U fvcore
|
| 30 |
+
```
|
| 31 |
+
### Dataset Preparation
|
| 32 |
+
We evaluate our method on three public datasets: **LEVIR-CD**, **WHU-CD**, and **CLCD**.
|
| 33 |
|
| 34 |
+
| Dataset | Link |
|
| 35 |
+
|-----------|------|
|
| 36 |
+
| LEVIR-CD | [Download](https://drive.google.com/file/d/1MEKc9UTM3j4zPFfkvFvjjsynGjZ5tRrF/view?usp=drive_link) |
|
| 37 |
+
| WHU-CD | [Download](https://drive.google.com/file/d/1N73eO20hjtEyYd33M6119U03DYkHjm5i/view?usp=drive_link) |
|
| 38 |
+
| CLCD | [Download](https://drive.google.com/file/d/19eW-Yad3SSiQNuB8WT5XOnvPvjxCp1Cz/view?usp=drive_link) |
|
| 39 |
+
```bash
|
| 40 |
+
Please organize the datasets as follows:
|
| 41 |
+
rschangedetection
|
| 42 |
+
βββ rscd (code)
|
| 43 |
+
βββ work_dirs (save the model weights and training logs)
|
| 44 |
+
β ββCLCD_BS4_epoch200 (dataset)
|
| 45 |
+
β ββstnet (model)
|
| 46 |
+
β ββversion_0 (version)
|
| 47 |
+
β β ββckpts
|
| 48 |
+
β β ββtest (the best ckpts in test set)
|
| 49 |
+
β β ββval (the best ckpts in validation set)
|
| 50 |
+
β ββlog (tensorboard logs)
|
| 51 |
+
β ββtrain_metrics.txt (train & val results per epoch)
|
| 52 |
+
β ββtest_metrics_max.txt (the best test results)
|
| 53 |
+
β ββtest_metrics_rest.txt (other test results)
|
| 54 |
+
βββ data
|
| 55 |
+
βββ LEVIR_CD
|
| 56 |
+
β βββ train
|
| 57 |
+
β β βββ A
|
| 58 |
+
β β β βββ images1.png
|
| 59 |
+
β β βββ B
|
| 60 |
+
β β β βββ images2.png
|
| 61 |
+
β β βββ label
|
| 62 |
+
β β βββ label.png
|
| 63 |
+
β βββ val (the same with train)
|
| 64 |
+
β βββ test(the same with train)
|
| 65 |
+
βββ WHU_CD
|
| 66 |
+
β βββ train
|
| 67 |
+
β β βββ image1
|
| 68 |
+
β β β βββ images1.png
|
| 69 |
+
β β βββ image2
|
| 70 |
+
β β β βββ images2.png
|
| 71 |
+
β β βββ label
|
| 72 |
+
β β βββ label.png
|
| 73 |
+
β βββ val (the same with train)
|
| 74 |
+
β βββ test(the same with train)
|
| 75 |
+
βββ CLCD (the same with WHU_CD)
|
| 76 |
+
```
|
| 77 |
+
### Use example
|
| 78 |
+
Training
|
| 79 |
+
```bash
|
| 80 |
+
python train.py -c configs/mamba_cttf.py
|
| 81 |
+
```
|
| 82 |
+
Testing
|
| 83 |
+
```bash
|
| 84 |
+
python test.py \
|
| 85 |
+
-c configs/mamba_cttf.py \
|
| 86 |
+
--ckpt work_dirs/CLCD_BS4_epoch200/mamba_cttf/version_0/ckpts/test/epoch=156.ckpt \
|
| 87 |
+
--output_dir work_dirs/CLCD_BS4_epoch200/mamba_cttf/version_0/ckpts/test \
|
| 88 |
+
```
|
| 89 |
+
Count params and flops
|
| 90 |
+
```bash
|
| 91 |
+
python tools/params_flops.py --size 256
|
| 92 |
+
```
|
| 93 |
|
| 94 |
+
### Acknowledgement
|
| 95 |
+
Thanks to previous open-sourced repo:
|
| 96 |
+
- [mmsegmentation](https://github.com/open-mmlab/mmsegmentation)
|
| 97 |
+
- [pytorch lightning](https://github.com/Lightning-AI/lightning)
|
| 98 |
+
- [fvcore](https://github.com/facebookresearch/fvcore)
|