File size: 3,207 Bytes
fa7be76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---

title: Cloudseg
emoji: πŸ“š
colorFrom: blue
colorTo: red
sdk: gradio
sdk_version: 4.40.0
app_file: app.py
pinned: false
license: apache-2.0
---

# Cloud Segmentation

[![demo](https://img.shields.io/badge/πŸ€—HugginngFace-Spaces-orange)](https://huggingface.co/spaces/caixiaoshun/cloudseg)
[![python](https://img.shields.io/badge/-Python_3.8_%7C_3.9_%7C_3.10-blue?logo=python&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![pytorch](https://img.shields.io/badge/PyTorch_2.0+-ee4c2c?logo=pytorch&logoColor=white)](https://pytorch.org/get-started/locally/)
[![lightning](https://img.shields.io/badge/-Lightning_2.0+-792ee5?logo=pytorchlightning&logoColor=white)](https://pytorchlightning.ai/)
[![hydra](https://img.shields.io/badge/Config-Hydra_1.3-89b8cd)](https://hydra.cc/)
[![license](https://img.shields.io/badge/License-MIT-green.svg?labelColor=gray)](https://github.com/XavierJiezou/cloudseg#license)
[![contributors](https://img.shields.io/github/contributors/XavierJiezou/cloudseg.svg)](https://github.com/XavierJiezou/cloudseg/graphs/contributors)
[![Template](https://img.shields.io/badge/-Lightning--Hydra--Template-017F2F?style=flat&logo=github&labelColor=gray)](https://github.com/ashleve/lightning-hydra-template)
[![Paper](http://img.shields.io/badge/paper-arxiv.1001.2234-B31B1B.svg)](https://www.nature.com/articles/nature14539)
[![Conference](http://img.shields.io/badge/AnyConference-year-4b44ce.svg)](https://papers.nips.cc/paper/2020)

## Datasets

```bash

cloudseg

β”œβ”€β”€ src

β”œβ”€β”€ configs

β”œβ”€β”€ data

β”‚   β”œβ”€β”€ hrcwhu

β”‚   β”‚   β”œβ”€β”€ train.txt

β”‚   β”‚   β”œβ”€β”€ test.txt

β”‚   β”‚   β”œβ”€β”€ img_dir

β”‚   β”‚   β”‚   β”œβ”€β”€ train

β”‚   β”‚   β”‚   β”œβ”€β”€ test

β”‚   β”‚   β”œβ”€β”€ ann_dir

β”‚   β”‚   β”‚   β”œβ”€β”€ train

β”‚   β”‚   β”‚   β”œβ”€β”€ test

```

## Supported Methods

- [UNet (MICCAI 2016)](configs/model/unet)
- [CDNetv1 (TGRS 2019)](configs/model/cdnetv1)
- [CDNetv2 (TGRS 2021)](configs/model/cdnetv2)
- [DBNet (TGRS 2022)](configs/model/dbnet)
- [HrCloudNet (JEI 2024)](configs/model/hrcloudnet)
- [McdNet (International Journal of Applied Earth Observation and Geoinformation 2024)](configs/model/mcdnet)
- [Scnn (ISPRS 2024)](configs/model/scnn)

## Installation

```bash

git clone https://github.com/XavierJiezou/cloudseg.git

cd cloudseg

conda env create -f environment.yaml

conda activate cloudseg

```

## Usage

**Train model with default configuration**

```bash

# train on CPU

python src/train.py trainer=cpu



# train on GPU

python src/train.py trainer=gpu

```

**Train model with chosen experiment configuration from [configs/experiment/](configs/experiment/)**

```bash

python src/train.py experiment=experiment_name.yaml

```

**Tranin Example**

```bash

python src/train.py experiment=hrcwhu_cdnetv1.yaml

```

**You can override any parameter from command line like this**

```bash

python src/train.py trainer.max_epochs=20 data.batch_size=64

```

**Visualization in wandb**

```bash

python wand_vis.py --model-name model_name

```

**Example**

```bash

python wand_vis.py --model-name cdnetv1

```