InPeerReview's picture
Update README.md
50754c6 verified
|
raw
history blame
3.35 kB
## πŸ› οΈ Requirements
### Environment
- **Linux system**, Windows is not tested, depending on whether and can be installed `causal-conv1d` and `mamba-ssm`
- **Python** 3.8+, recommended 3.10
- **PyTorch** 2.0 or higher, recommended 2.1.0
- **CUDA** 11.7 or higher, recommended 12.1
### Environment Installation
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.
```bash
# Create conda environment
conda create -n stnr python=3.8 -y
conda activate stnr
# Install PyTorch
pip install torch==2.1.0 torchvision==0.14.0 torchaudio==0.13.0
# Install dependencies
pip install causal_conv1d mamba_ssm packaging
pip install timm==0.4.12
pip install pytest chardet yacs termcolor
pip install submitit tensorboardX
pip install triton==2.0.0
# Or simply run
pip install -r requirements.txt
```
## πŸ“ Dataset Preparation
We evaluate our method on five remote sensing change detection datasets: **WHU-CD**, **LEVIR-CD**, **LEVIR-CD+**, **SYSU-CD**, and **SVCD**.
| Dataset | Link |
|---------|------|
| WHU-CD | [Download](https://github.com/RuiZhang97/ISNet) |
| LEVIR-CD | [Download](https://github.com/YimianDai/sirst) |
| LEVIR-CD+ | [Download](https://github.com/Tianfang-Zhang/AGPCNet) |
| SYSU-CD | [Download](https://github.com/Tianfang-Zhang/AGPCNet) |
| SVCD | [Download](https://github.com/Tianfang-Zhang/AGPCNet) |
Please organize the datasets as follows:
```
${DATASET_ROOT} # Dataset root directory, for example: /home/username/data/LEVIR-CD
β”œβ”€β”€ A
β”‚ β”œβ”€β”€ train_1_1.png
β”‚ β”œβ”€β”€ train_1_2.png
β”‚ β”œβ”€β”€...
β”‚ β”œβ”€β”€ val_1_1.png
β”‚ β”œβ”€β”€ val_1_2.png
β”‚ β”œβ”€β”€...
β”‚ β”œβ”€β”€ test_1_1.png
β”‚ β”œβ”€β”€ test_1_2.png
β”‚ └── ...
β”œβ”€β”€ B
β”‚ β”œβ”€β”€ train_1_1.png
β”‚ β”œβ”€β”€ train_1_2.png
β”‚ β”œβ”€β”€...
β”‚ β”œβ”€β”€ val_1_1.png
β”‚ β”œβ”€β”€ val_1_2.png
β”‚ β”œβ”€β”€...
β”‚ β”œβ”€β”€ test_1_1.png
β”‚ β”œβ”€β”€ test_1_2.png
β”‚ └── ...
β”œβ”€β”€ label
β”‚ β”œβ”€β”€ train_1_1.png
β”‚ β”œβ”€β”€ train_1_2.png
β”‚ β”œβ”€β”€...
β”‚ β”œβ”€β”€ val_1_1.png
β”‚ β”œβ”€β”€ val_1_2.png
β”‚ β”œβ”€β”€...
β”‚ β”œβ”€β”€ test_1_1.png
β”‚ β”œβ”€β”€ test_1_2.png
β”‚ └── ...
β”œβ”€β”€ list
β”‚ β”œβ”€β”€ train.txt
β”‚ β”œβ”€β”€ val.txt
β”‚ └── test.txt
```
## πŸ”§ Model Training and Testing
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.
### Example of Training on LEVIR-CD Dataset
```bash
python train_cd.py --config/levir/levir.json
```
### Example of Training on LEVIR-CD Dataset
```bash
python test_cd.py --config/levir/levir_test.json
```
## πŸ“‚ Project Structure
```
STNR-Det/
β”œβ”€β”€ dataset/ # Dataset loading and preprocessing
β”œβ”€β”€ model/ # Network architecture (STNR-Det)
β”œβ”€β”€ utils/ # Utility functions
β”œβ”€β”€ weight/ # Pretrained weights
β”œβ”€β”€ main.py # Main entry point
β”œβ”€β”€ requirements.txt # Dependencies
└── README.md
```