First place solution of the of the Zindi AgriFieldNet India Challenge for Crop Types Detection from Satellite Imagery.
MLHub model id: model_ecaas_agrifieldnet_gold_v1
. Browse on Radiant MLHub.
Please review the model architecture, license, applicable spatial and temporal extents and other details in the model documentation.
- Git client
- Python 3.8
- R 4.2.2
Training | Inferencing | |
---|---|---|
RAM | 25 GB RAM | 16 GB RAM |
NVIDIA GPU | Required | Optional (but very slow for Unet model) |
Start by cloning this repository to get the model scripts and saved model checkpoint files:
git clone https://github.com/radiantearth/model_ecaas_agrifieldnet_gold.git
cd model_ecaas_agrifieldnet_gold/
To get started, the R and Python dependencies must to be installed locally in your environment. Alternatively you can look at the original AgriFieldNet Challenge solution scripts (.zip) which are linked in the model documentation.
R 4.2.2 is required for the data preprocessing and feature engineering step of the model.
R -e "install.packages(c('devtools', 'plyr', 'tidyverse', 'raster', 'celestial', 'caret', 'fastICA', 'SOAR', 'RStoolbox', 'jsonlite', 'data.table', 'spdep'))"
R -e "devtools::install_github('OpenDroneMap/FIELDimageR')"
Python 3.8 is required for the model training and inferencing steps.
pip install --upgrade pip
pip install -r requirements.txt
-
Prepare your input and output data folders. The
data/
folder in this repository contains some placeholder files to guide you.- The
data/
folder must contain:input/ref_agrifieldnet_competition_v1
: for inferencing:ref_agrifieldnet_competition_v1_source
: folder containing for the satellite imagery bandsref_agrifieldnet_competition_v1_source_{folder_id}
: e.g.ref_agrifieldnet_competition_v1_source_0a1d5
ref_agrifieldnet_competition_v1_labels_test
: containing the field idsref_agrifieldnet_competition_v1_labels_test_{folder_id}
: e.g.ref_agrifieldnet_competition_v1_labels_test_0a1d5
- The
output/
folder is where the model will write inferencing results.
- The
-
Set
INPUT_DATA
andOUTPUT_DATA
environment variables corresponding with your input and output folders. These commands will vary depending on operating system and command-line shell:# change paths to your actual input and output folders export INPUT_DATA="/home/my_user/model_ecaas_agrifieldnet_gold/data/input/" export OUTPUT_DATA="/home/my_user/model_ecaas_agrifieldnet_gold/data/output/"
-
Run the
run_models.sh
bash shell script../run_models.sh
-
Wait for the script to finish running, then inspect the
OUTPUT_DATA
folder for results. If you run into errors, or missing packages, alternatively you can look at the original AgriFieldNet Challenge solution scripts (.zip) which are linked in the model documentation.
Please review the model output format and other technical details in the model documentation.