This repository adapts TerraTorch to compare the performance of Prithvi GFM on the BioMassters benchmark dataset. TerraTorch is a PyTorch domain library based on PyTorch Lightning and the TorchGeo domain library for geospatial data.
To replicate experiments as performed after cloning this repository to the host machine:
- Download the BioMassters dataset from Huggingface: https://huggingface.co/datasets/ibm-nasa-geospatial/BioMassters to the host machine.
- Modify the paths in the
compose.ymlvolumes to match each directory on the host machine. - Run the command:
docker compose up -din the repository. This will build the docker image and start the service. Note that, since the image installs Terratorch in editable mode each time it is run, the terratorch command will not be available in the container until 5-10 minutes after it starts. The availablility of terratorch can be confirmed by opening a bash terminal in the container, activating the venv by runningsource venv/bin/activate, and runningterratorch -h. - Run
pip install terratorch[peft]once terratorch has been installed. - The script for running all Biomassters experiments is
examples/scripts/biomassters/paper_experiments.sh. The configuration files are inexamples/confs/biomassters/final_experiments.sh. Which GPU each experiment runs on can be changed withinpaper_experiments.sh, certain experiments can be turned on and off by commenting them out, and batch size can be customized within each configuration file. Modify these to run the desired experiments with the desired batch sizes on the desired GPUs, and modify thepaper_experiments.shscript to reflect the correct path to thecompose.ymlon the host machine. - Navigate to
examples/scripts/biomassters/on the host machine and runchmod +x paper_experiments.shto make the paper experiment script executable. Then, run./paper_experiments.shin the terminal on the host machine. This will execute all specified experiments. - After experiments complete, all checkpoints can be tested on the test set using the
examples/scripts/biomassters/test_all.shscript. - If outputs of the baseline on the test set have been generated, figures may be generated using the
examples/scripts/biomassters/create_figures.pyscript, which can be run from within the container.