Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,113 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## π οΈ Requirements
|
| 2 |
+
|
| 3 |
+
### Environment
|
| 4 |
+
- **Linux system**, Windows is not tested, depending on whether and can be installed `causal-conv1d` and `mamba-ssm`
|
| 5 |
+
- **Python** 3.8+, recommended 3.10
|
| 6 |
+
- **PyTorch** 2.0 or higher, recommended 2.1.0
|
| 7 |
+
- **CUDA** 11.7 or higher, recommended 12.1
|
| 8 |
+
|
| 9 |
+
### Environment Installation
|
| 10 |
+
|
| 11 |
+
It is recommended to use Miniconda for installation. The following commands will create a virtual environment named `stnr` and install PyTorch. In the following installation steps, the default installed CUDA version is 12.1. If your CUDA version is not 12.1, please modify it according to the actual situation.
|
| 12 |
+
|
| 13 |
+
```bash
|
| 14 |
+
# Create conda environment
|
| 15 |
+
conda create -n stnr python=3.8 -y
|
| 16 |
+
conda activate stnr
|
| 17 |
+
|
| 18 |
+
# Install PyTorch
|
| 19 |
+
pip install torch==2.1.0 torchvision==0.14.0 torchaudio==0.13.0
|
| 20 |
+
|
| 21 |
+
# Install dependencies
|
| 22 |
+
pip install causal_conv1d mamba_ssm packaging
|
| 23 |
+
pip install timm==0.4.12
|
| 24 |
+
pip install pytest chardet yacs termcolor
|
| 25 |
+
pip install submitit tensorboardX
|
| 26 |
+
pip install triton==2.0.0
|
| 27 |
+
|
| 28 |
+
# Or simply run
|
| 29 |
+
pip install -r requirements.txt
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
## π Dataset Preparation
|
| 33 |
+
|
| 34 |
+
We evaluate our method on five remote sensing change detection datasets: **WHU-CD**, **LEVIR-CD**, **LEVIR-CD+**, **SYSU-CD**, and **SVCD**.
|
| 35 |
+
|
| 36 |
+
| Dataset | Link |
|
| 37 |
+
|---------|------|
|
| 38 |
+
| WHU-CD | [Download](https://github.com/RuiZhang97/ISNet) |
|
| 39 |
+
| LEVIR-CD | [Download](https://github.com/YimianDai/sirst) |
|
| 40 |
+
| LEVIR-CD+ | [Download](https://github.com/Tianfang-Zhang/AGPCNet) |
|
| 41 |
+
| SYSU-CD | [Download](https://github.com/Tianfang-Zhang/AGPCNet) |
|
| 42 |
+
| SVCD | [Download](https://github.com/Tianfang-Zhang/AGPCNet) |
|
| 43 |
+
|
| 44 |
+
Please organize the datasets as follows:
|
| 45 |
+
|
| 46 |
+
```
|
| 47 |
+
${DATASET_ROOT} # Dataset root directory, for example: /home/username/data/LEVIR-CD
|
| 48 |
+
βββ A
|
| 49 |
+
β βββ train_1_1.png
|
| 50 |
+
β βββ train_1_2.png
|
| 51 |
+
β βββ...
|
| 52 |
+
β βββ val_1_1.png
|
| 53 |
+
β βββ val_1_2.png
|
| 54 |
+
β βββ...
|
| 55 |
+
β βββ test_1_1.png
|
| 56 |
+
β βββ test_1_2.png
|
| 57 |
+
β βββ ...
|
| 58 |
+
βββ B
|
| 59 |
+
β βββ train_1_1.png
|
| 60 |
+
β βββ train_1_2.png
|
| 61 |
+
β βββ...
|
| 62 |
+
β βββ val_1_1.png
|
| 63 |
+
β βββ val_1_2.png
|
| 64 |
+
β βββ...
|
| 65 |
+
β βββ test_1_1.png
|
| 66 |
+
β βββ test_1_2.png
|
| 67 |
+
β βββ ...
|
| 68 |
+
βββ label
|
| 69 |
+
β βββ train_1_1.png
|
| 70 |
+
β βββ train_1_2.png
|
| 71 |
+
β βββ...
|
| 72 |
+
β βββ val_1_1.png
|
| 73 |
+
β βββ val_1_2.png
|
| 74 |
+
β βββ...
|
| 75 |
+
β βββ test_1_1.png
|
| 76 |
+
β βββ test_1_2.png
|
| 77 |
+
β βββ ...
|
| 78 |
+
βββ list
|
| 79 |
+
β βββ train.txt
|
| 80 |
+
β βββ val.txt
|
| 81 |
+
β βββ test.txt
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
## π§ Model Training and Testing
|
| 86 |
+
|
| 87 |
+
All configuration for model training and testing is stored in the local folder `config`. Below are the example commands to train and test the model on the **LEVIR-CD** dataset.
|
| 88 |
+
|
| 89 |
+
### Example of Training on LEVIR-CD Dataset
|
| 90 |
+
|
| 91 |
+
```bash
|
| 92 |
+
python train_cd.py --config/levir/levir.json
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
### Example of Training on LEVIR-CD Dataset
|
| 96 |
+
|
| 97 |
+
```bash
|
| 98 |
+
python test_cd.py --config/levir/levir_test.json
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
## π Project Structure
|
| 102 |
+
|
| 103 |
+
```
|
| 104 |
+
STNR-Det/
|
| 105 |
+
βββ dataset/ # Dataset loading and preprocessing
|
| 106 |
+
βββ model/ # Network architecture (STNR-Det)
|
| 107 |
+
βββ utils/ # Utility functions
|
| 108 |
+
βββ weight/ # Pretrained weights
|
| 109 |
+
βββ main.py # Main entry point
|
| 110 |
+
βββ requirements.txt # Dependencies
|
| 111 |
+
βββ README.md
|
| 112 |
+
|
| 113 |
+
```
|