Competition Page: https://www.drivendata.org/competitions/99/biomass-estimation/page/536/
conda create --name biomassters python=3.9
conda activate biomassters
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
pip install -r requirements.txt
- Download Metadata from DATA DOWNLOAD page, and put all files in ./data/information in following structure:
./data/information
├── biomassters-download-instructions.txt # Instructions to download satellite images and AGBM data
├── features_metadata.csv # Metadata for satellite images
└── train_agbm_metadata.csv # Metadata for training set AGBM tifs
- Download Image data by running
./scripts/download.sh
, data is saved in ./data/source:
./data/source
├── test
│ ├── aa5e092e
│ │ ├── S1
│ │ │ ├── aa5e092e_S1_00.tif
│ │ │ ├── ...
│ │ │ └── aa5e092e_S1_11.tif
│ │ └── S2
│ │ ├── aa5e092e_S2_00.tif
│ │ ├── ...
│ │ └── aa5e092e_S2_11.tif
| ├── ...
│ └── fff812c0
└── train
├── aa018d7b
├── ...
└── fff05995
- Calculate statistics for normalization and split dataset into 5 folds by running
./scripts/process.sh
:
./data/source
├── plot # data distribution
├── splits.pkl # 5 folds for cross validation
├── stats_log2.pkl # statistics of log2 transformed dataset
├── stats_plain.pkl # statistics of original dataset
├── test
└── train
Train model with arguments:
data_root
: root directory of training datasetexp_root
: root direcroty to save checkpoints, logs and modelsconfig_file
: file path of configurationsprocess_method
: processing method to calculate statistics,log2
orplain
folds
: list of folds, separated by,
device=0
process=plain
folds=0,1,2,3,4
data_root=./data/source
config_file=./configs/swin_unetr/exp1.yaml
CUDA_VISIBLE_DEVICES=$device \
python train.py \
--data_root $data_root \
--exp_root ./experiments/$process \
--config_file $config_file \
--process_method $process \
--folds $folds
Make predictions with almost the same arguments as training:
data_root
: root directory of training datasetexp_root
: root direcroty to save checkpoints, logs and modelsoutput_root
: root directory to save predictionsconfig_file
: file path of configurationsprocess_method
: processing method to calculate statistics,log2
orplain
folds
: list of folds, separated by,
apply_tta
: if apply test-time augmentation
device=0
process=plain
folds=0,1,2,3,4
apply_tta=false
data_root=./data/source
config_file=./configs/swin_unetr/exp1.yaml
CUDA_VISIBLE_DEVICES=$device \
python predict.py \
--data_root $data_root \
--exp_root ./experiments/$process \
--output_root ./predictions/$process \
--config_file $config_file \
--process_method $process \
--folds $folds \
--apply_tta $apply_tta