From c55e369c0c76eaca1ec0bcff3e8c440b1a2534b0 Mon Sep 17 00:00:00 2001 From: KerekesDavid Date: Fri, 18 Oct 2024 12:30:59 +0200 Subject: [PATCH] Use focus crop on mados --- DATASET_GUIDE.md | 3 ++- configs/preprocessing/seg_focus_crop.yaml | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 configs/preprocessing/seg_focus_crop.yaml diff --git a/DATASET_GUIDE.md b/DATASET_GUIDE.md index b523c58..19c3668 100644 --- a/DATASET_GUIDE.md +++ b/DATASET_GUIDE.md @@ -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: @@ -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 ``` diff --git a/configs/preprocessing/seg_focus_crop.yaml b/configs/preprocessing/seg_focus_crop.yaml new file mode 100644 index 0000000..de1fa1d --- /dev/null +++ b/configs/preprocessing/seg_focus_crop.yaml @@ -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 +