Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow multiple outputs for inference results #175

Merged
merged 5 commits into from
Oct 8, 2024

Conversation

jdegerickx
Copy link
Contributor

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...

Copy link
Contributor

@kvantricht kvantricht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice evolution! But I added quite a few comments to think about and we can discuss on Monday. File naming consistency is something we have to think about carefully.

src/worldcereal/job.py Show resolved Hide resolved
src/worldcereal/job.py Outdated Show resolved Hide resolved
src/worldcereal/job.py Outdated Show resolved Hide resolved
src/worldcereal/job.py Outdated Show resolved Hide resolved
src/worldcereal/job.py Outdated Show resolved Hide resolved
src/worldcereal/openeo/mapping.py Outdated Show resolved Hide resolved
src/worldcereal/openeo/mapping.py Outdated Show resolved Hide resolved
src/worldcereal/job.py Outdated Show resolved Hide resolved
src/worldcereal/job.py Outdated Show resolved Hide resolved
src/worldcereal/job.py Outdated Show resolved Hide resolved
src/worldcereal/job.py Outdated Show resolved Hide resolved
src/worldcereal/openeo/mapping.py Outdated Show resolved Hide resolved
src/worldcereal/openeo/mapping.py Outdated Show resolved Hide resolved
src/worldcereal/openeo/mapping.py Outdated Show resolved Hide resolved
@jdegerickx jdegerickx changed the base branch from main to 135-refactor-demo October 8, 2024 13:21
@kvantricht kvantricht self-requested a review October 8, 2024 13:28
Copy link
Contributor

@kvantricht kvantricht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to go!

@jdegerickx jdegerickx merged commit 0c54fc6 into 135-refactor-demo Oct 8, 2024
@jdegerickx jdegerickx deleted the 174-support-multioutput branch October 8, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants