Skip to content

Commit

Permalink
Use focus crop on mados
Browse files Browse the repository at this point in the history
  • Loading branch information
KerekesDavid committed Oct 18, 2024
1 parent 959f9f0 commit c55e369
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DATASET_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This document provides a detailed overview of the datasets used in this reposito
### MADOS

- The code supports automatic downloading of the dataset into `./data` folder.
- Random cropping to encoder size is done with focus cropping. This avoids batches with no loss, caused by the high ratio of unlabeled pixels ion the dataset.
- The basic experiment uses mean and std values for normalization and applies random cropping to align images with the size used for GFMs pretraining.
Below is a CLI example for running the experiment with the RemoteClip pretrained encoder and UperNet segmentation decoder:

Expand All @@ -31,7 +32,7 @@ This document provides a detailed overview of the datasets used in this reposito
dataset=mados \
encoder=remoteclip \
decoder=seg_upernet\
preprocessing=seg_default \
preprocessing=seg_focus_crop \
criterion=cross_entropy \
task=segmentation
```
Expand Down
22 changes: 22 additions & 0 deletions configs/preprocessing/seg_focus_crop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
train:
_target_: pangaea.engine.data_preprocessor.Preprocessor
preprocessor_cfg:
- _target_: pangaea.engine.data_preprocessor.FocusRandomCropToEncoder
- _target_: pangaea.engine.data_preprocessor.BandFilter
- _target_: pangaea.engine.data_preprocessor.NormalizeMeanStd
- _target_: pangaea.engine.data_preprocessor.BandPadding

val:
_target_: pangaea.engine.data_preprocessor.Preprocessor
preprocessor_cfg:
- _target_: pangaea.engine.data_preprocessor.BandFilter
- _target_: pangaea.engine.data_preprocessor.NormalizeMeanStd
- _target_: pangaea.engine.data_preprocessor.BandPadding

test:
_target_: pangaea.engine.data_preprocessor.Preprocessor
preprocessor_cfg:
- _target_: pangaea.engine.data_preprocessor.BandFilter
- _target_: pangaea.engine.data_preprocessor.NormalizeMeanStd
- _target_: pangaea.engine.data_preprocessor.BandPadding

0 comments on commit c55e369

Please sign in to comment.