Skip to content

Commit e5bb98f

Browse files
committed
Fix the information on FMC cfg
1 parent c069533 commit e5bb98f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

configs/fmc_processings/ga_s2ab_nbart_dea_fmc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ product:
5858
- landsat:wrs_row
5959
- fmask:clear
6060

61-
model_path: https://dea-public-data-dev.s3.ap-southeast-2.amazonaws.com/projects/burn_cube/configs/RF_model_ARDC_version.joblib
61+
model_path: https://dea-public-data-dev.s3.ap-southeast-2.amazonaws.com/projects/burn_cube/configs/RF_AllBands_noLC_DEA_labeless.joblib

scripts/fmc_processing_script.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ def classify_FMC(data, model):
8484
return dataset_result
8585

8686

87+
def download_file_from_s3_public(url, file_path):
88+
response = requests.get(url)
89+
if response.status_code == 200:
90+
with open(file_path, "wb") as f:
91+
f.write(response.content)
92+
print(f"File downloaded successfully from: {url}")
93+
else:
94+
print(f"Failed to download file from: {url}")
95+
96+
8797
@click.command(no_args_is_help=True)
8898
@click.option(
8999
"--task-id",
@@ -131,6 +141,13 @@ def fmc_processing(
131141

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

144+
# Define the path to the saved machine learning model file.
145+
model_path = "RF_AllBands_noLC_DEA_labeless.joblib"
146+
147+
# auto download Machine Learning model from AWS S3
148+
149+
download_file_from_s3_public(model_url, model_path)
150+
134151
# import model: move it to fmc processing cfg file
135152
model = joblib.load(model_url)
136153

0 commit comments

Comments
 (0)