Skip to content

Commit

Permalink
Fix the information on FMC cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
supermarkion committed Dec 19, 2024
1 parent c069533 commit e5bb98f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configs/fmc_processings/ga_s2ab_nbart_dea_fmc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ product:
- landsat:wrs_row
- fmask:clear

model_path: https://dea-public-data-dev.s3.ap-southeast-2.amazonaws.com/projects/burn_cube/configs/RF_model_ARDC_version.joblib
model_path: https://dea-public-data-dev.s3.ap-southeast-2.amazonaws.com/projects/burn_cube/configs/RF_AllBands_noLC_DEA_labeless.joblib
17 changes: 17 additions & 0 deletions scripts/fmc_processing_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ def classify_FMC(data, model):
return dataset_result


def download_file_from_s3_public(url, file_path):
response = requests.get(url)
if response.status_code == 200:
with open(file_path, "wb") as f:
f.write(response.content)
print(f"File downloaded successfully from: {url}")
else:
print(f"Failed to download file from: {url}")


@click.command(no_args_is_help=True)
@click.option(
"--task-id",
Expand Down Expand Up @@ -131,6 +141,13 @@ def fmc_processing(

dc = datacube.Datacube(app="fmc_processing")

# Define the path to the saved machine learning model file.
model_path = "RF_AllBands_noLC_DEA_labeless.joblib"

# auto download Machine Learning model from AWS S3

download_file_from_s3_public(model_url, model_path)

# import model: move it to fmc processing cfg file
model = joblib.load(model_url)

Expand Down

0 comments on commit e5bb98f

Please sign in to comment.