Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use focus crop on mados #101

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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