Skip to content

Commit

Permalink
update reamde
Browse files Browse the repository at this point in the history
  • Loading branch information
yurujaja committed Sep 16, 2024
2 parents 9fdd93c + ef8691f commit 05dd89e
Show file tree
Hide file tree
Showing 22 changed files with 678 additions and 87 deletions.
52 changes: 52 additions & 0 deletions configs/datasets/dynamicen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
dataset_name: DynamicEarthNet
root_path: ./data/DynamicEarthNet
download_url: None
auto_download: False

img_size: 1024
multi_temporal: False
multi_modal: False

# classes
ignore_index: -1
num_classes: 6
classes:
- impervious surface
- agriculture
- forest & other vegetation
- wetlands
- soil
- water
distribution:
- 0.071
- 0.103
- 0.449
- 0.07
- 0.28
- 0.08

# data stats
bands:
optical:
- B2
- B3
- B4
- B5

data_mean:
optical:
- 1042.59240722656
- 915.618408203125
- 671.260559082031
- 2605.20922851562
data_std:
optical:
- 957.958435058593
- 715.548767089843
- 596.943908691406
- 1059.90319824218

data_min:
optical: [0.0000, 0.0000, 0.0000, 0.0000]
data_max:
optical: [0.0000, 0.0000, 0.0000, 0.0000]
7 changes: 6 additions & 1 deletion configs/datasets/spacenet7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ root_path: ./data/spacenet7
download_url: https://drive.google.com/uc?id=1BADSEjxYKFZZlM-tEkRUfHvHi5XdaVV9
auto_download: True

img_size: 1024
img_size: 256 # the image size is used to tile the SpaceNet 7 images (1024, 1024)
domain_shift: False
# parameters for within-scene splits (no domain shift)
i_split: 768
j_split: 512

multi_temporal: False
multi_modal: False

Expand Down
44 changes: 44 additions & 0 deletions configs/datasets/spacenet7_domainshift.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
dataset_name: SN7MAPPING
root_path: ./data/spacenet7
download_url: https://drive.google.com/uc?id=1BADSEjxYKFZZlM-tEkRUfHvHi5XdaVV9
auto_download: True

img_size: 256 # the image size is used to tile the SpaceNet 7 images (1024, 1024)
domain_shift: True
# parameters for within-scene splits (no domain shift)
i_split: 768
j_split: 512

multi_temporal: False
multi_modal: False

# classes
ignore_index: -1
num_classes: 2
classes:
- Background
- Building
distribution:
- 0.92530769
- 0.07469231

# data stats
bands:
optical:
- B4 # Band 1 (Red)
- B3 # Band 2 (Green)
- B2 # Band 3 (Blue)
data_mean:
optical:
- 121.826
- 106.52838
- 78.372116
data_std:
optical:
- 56.717068
- 44.517075
- 40.451515
data_min:
optical: [0.0, 0.0, 0.0]
data_max:
optical: [255.0, 255.0, 255.0]
9 changes: 8 additions & 1 deletion configs/datasets/spacenet7cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ root_path: ./data/spacenet7
download_url: https://drive.google.com/uc?id=1BADSEjxYKFZZlM-tEkRUfHvHi5XdaVV9
auto_download: True

img_size: 1024
img_size: 256 # the image size is used to tile the SpaceNet 7 images (1024, 1024)
domain_shift: False
# parameters for within-scene splits (no domain shift)
i_split: 768
j_split: 512

multi_temporal: 2
multi_modal: False

dataset_multiplier: 1 # multiplies sample in dataset during training

# classes
ignore_index: -1
num_classes: 2
Expand Down
38 changes: 38 additions & 0 deletions configs/foundation_models/croma_joint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
encoder_name: CROMA_JOINT_Encoder
foundation_model_name: CROMA_JOINT_large
encoder_weights: ./pretrained_models/CROMA_large.pt
download_url: https://huggingface.co/antofuller/CROMA/resolve/main/CROMA_large.pt
temporal_input: False


num_layers: 24
embed_dim: 1024
input_size: 120 # the paper uses 120

encoder_model_args:
size: 'large'
image_resolution: 120

input_bands:
optical:
- B1
- B2
- B3
- B4
- B5
- B6
- B7
- B8
- B8A
- B9
- B11
- B12
sar:
- VV
- VH

output_layers:
- 3
- 5
- 7
- 11
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ input_bands:
- B9
- B11
- B12
sar:
- VV
- VH

output_layers:
- 3
Expand Down
25 changes: 25 additions & 0 deletions configs/foundation_models/croma_sar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
encoder_name: CROMA_SAR_Encoder
foundation_model_name: CROMA_SAR_large
encoder_weights: ./pretrained_models/CROMA_large.pt
download_url: https://huggingface.co/antofuller/CROMA/resolve/main/CROMA_large.pt
temporal_input: False


num_layers: 24
embed_dim: 1024
input_size: 120 # the paper uses 120

encoder_model_args:
size: 'large'
image_resolution: 120

input_bands:
sar:
- VV
- VH

output_layers:
- 3
- 5
- 7
- 11
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ input_bands:
- B10
- B11
- B12
sar:
- VV
- VH


output_layers:
- 3
Expand Down
30 changes: 30 additions & 0 deletions configs/foundation_models/ssl4eo_mae_sar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
encoder_name: SSL4EO_MAE_SAR_Encoder
foundation_model_name: ssl4eo_mae_vit_small_patch16
encoder_weights: ./pretrained_models/B2_vits16_mae_ep99.pth
download_url: https://huggingface.co/wangyi111/SSL4EO-S12/resolve/main/B2_vits16_mae_ep99.pth

temporal_input: False

num_layers: 12
embed_dim: 384
input_size: 224

encoder_model_args:
img_size: 224
in_chans: 2
embed_dim: 384
patch_size: 16
num_heads: 6
depth: 12
mlp_ratio: 4

input_bands:
sar:
- VV
- VH

output_layers:
- 3
- 5
- 7
- 11
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
segmentor_name: UNetCD
segmentor_name: SiamConcUNet
task_name: change-detection
binary: True
#task_model_args:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
segmentor_name: UPerNetCD
segmentor_name: SiamConcUPerNet
task_name: change-detection
binary: True
#task_model_args:
Expand Down
23 changes: 23 additions & 0 deletions configs/segmentors/siamdiffunet_binary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
segmentor_name: SiamDiffUNet
task_name: change-detection
binary: True
#task_model_args:
#num_frames: 1
#mt_strategy: "ltae" #activated only when if num_frames > 1
#num_classes - task parameter passed from the dataset config
#wave_list - task parameter passed from the dataset config

channels: 512

loss:
loss_name: DICELoss
ignore_index: -1

optimizer:
optimizer_name: AdamW
lr: 0.0001
weight_decay: 0.05

scheduler:
scheduler_name: MultiStepLR
lr_milestones: [0.6, 0.9]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
segmentor_name: UPerNetCD
segmentor_name: SiamDiffUPerNet
task_name: change-detection
binary: False
#task_model_args:
Expand Down
26 changes: 26 additions & 0 deletions configs/segmentors/siamdiffupernet_binary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
segmentor_name: SiamDiffUPerNet
task_name: change-detection
binary: True
#task_model_args:
#num_frames: 1
#mt_strategy: "ltae" #activated only when if num_frames > 1
#num_classes - task parameter passed from the dataset config
#wave_list - task parameter passed from the dataset config

channels: 512

loss:
loss_name: DICELoss
ignore_index: -1

optimizer:
optimizer_name: AdamW
lr: 0.0001
weight_decay: 0.05

scheduler:
scheduler_name: MultiStepLR
lr_milestones: [0.6, 0.9]



3 changes: 2 additions & 1 deletion datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
from .croptypemapping import CropTypeMappingSouthSudan
from .ai4smallfarms import AI4SmallFarms
from .spacenet7 import SN7MAPPING, SN7CD
from .fivebillionpixels import FiveBillionPixels
from .fivebillionpixels import FiveBillionPixels
from .utae_dynamicen import DynamicEarthNet
Loading

0 comments on commit 05dd89e

Please sign in to comment.