WorldCereal / worldcereal-classification

This repository contains the classification module of the WorldCereal system.
https://esa-worldcereal.org/
MIT License
37 stars 4 forks source link

allow multiple outputs for inference results #175

Closed jdegerickx closed 1 month ago

jdegerickx commented 1 month ago

When saving an intermediate result in openeo, one needs to specify the "filename_prefix" option in the "save_result" function. This was not done before, so the asset was overwritten by the final result.

I tested this for cropland inference and it works now, successfully generating 2 assets.

Instead of downloading the assets during the "execute_batch" call (which only supports download of a single asset), I have introduced a few lines which download all assets belonging to a certain job, including the metadata json file.

I changed the nature of InferenceResults, to be able to cope with multiple outputs for a single inference run. To do so, I renamed WorldCerealProduct to WorldCerealProductType (because this was actually a product type) and created a new data class WorldCerealProduct which now holds the URL, local path and product type of an actual product (raster file).

All changes were tested for the cropland inference case. I was not yet able to test inference for crop type, as the job failed due to another reason...