prithvi-usecases: Field boundary Mapping (Semantic Segmentation Task with High Class Imbalance)
git clone https://github.com/ClarkCGA/prithvi-usecases.git
cd [cloned_repo_path]
Replace [cloned_repo_path] with the actual path where the repository is cloned.
Make sure you have Conda installed before running the environment setup.
Step 2. Create the environment
conda env create -f environments.yaml
Step 3. How to do fine-tune for a semantic segmentation task
Get the pre-trained weights from HuggingFace
Adapt the custom_dataset.py to the specification of your dataset if needed.
Update the config.py
if you made changes to the dataset script, then also update the main_prithvi_aquaculture.py and then run it from the CLI:
torchrun --rdzv_endpoint=0.0.0.0:29500 main_prithvi_fieldboundary.py --config [path/to/your/config]
Step 4. How to do inference
Make sure the inference section of config.py is uptodated.
Run from CLI:
torchrun --rdzv_endpoint=0.0.0.0:29500 inference.py --config [path/to/your/inference/config]