We provide scripts for reproducing our the pretraining of our SeCo-Eco and MoCo-Eco models on our SSL4Eco dataset.
Note: If you have not done it already, make sure you downloaded the desired downstream datasets. See the data download section for this.
Note: If you intend to use our pretrained SeCo-Eco model, make sure you downloaded the weights from huggingface 🤗.
We use hydra for managing our script's arguments here. You can find the default config in default.yaml. The syntax for running the downstream evaluation of a model is simple:
# Set the SECOECO_ROOT variable to indicate where the datasets can be
# found and where the outputs will be saved
export SECOECO_ROOT=/root/path/to/your/datasets
# Evaluate SeCo-Eco on the biomes dataset, with linear probing
python main.py MODEL=secoeco DATASET=biomes PROBE=linear
# Evaluate Satlas on the arctic dataset, with k-NN
python main.py MODEL=satlas DATASET=arctic PROBE=knnThe complete list of supported models can be found here:
'ablcalendar'
'croma'
'dofabase'
'dofalarge'
'mocoeco'
'satlas'
'satmae'
'seco'
'secoeco'
'ssl4eo'The complete list of supported datasets can be found here:
'arctic'
'bigearthnet'
'biomassters'
'biomassterswinter'
'biomes'
'clef'
'clefblind'
'climate'
'euforest'
'euforestsp'
'treesatai'Please follow the instructions of data download section for image download. The corresponding index iles are in the index_files folder. The datasets are ready to use.
To prepare the BigEarthNet 10% dataset, please download the images from here and place the BigEarthNet-v1.0 folder into the BE_full folder.
Copy the train-test split into the BE_full folder:
cp ./index_files/be10/bigearthnet-train.csv ./BE_full/bigearthnet-train.csv
cp ./index_files/be10/bigearthnet-test.csv ./BE_full/bigearthnet-test.csvTo add NDVI band to BigEarthNet imagery, run
python ./downstream_tasks/add_ndvi_band_BE.py ./BE_full/imgsThe images for CLEF should be downloaded similar to other datasets to the folders sdm/clef/imgs based on coordinates from /index_files/sdm/clef_labels.csv index file. The blind part of the competition should be downloaded into sdm/clef_blind/imgs based on coordinates from /index_files/sdm/test_blind.csv index file.
The final score can be obtained by submitting the resulting prediction into the official Leaderboard.
Please download original dataset from here. The original data contain all Sentinel-2 bands except 1, 9 and 10. We only drop band 10, therefore band 1 and 9 need to be added manually as zero matrices along with the NDVI-band through the pre-proccessing script. From this point on, the dataset code automatically takes care of parsing the images and turning the pixel-wise AGBM labels into a 1-D label vector using binning.