IBM / terratorch

a Python toolkit for fine-tuning Geospatial Foundation Models (GFMs).
Apache License 2.0
131 stars 14 forks source link

Unify names, order and number of channels in config files #79

Open romeokienzler opened 1 month ago

romeokienzler commented 1 month ago

@Joao-L-S-Almeida is this already done?

Joao-L-S-Almeida commented 1 month ago

Do you mean to guarantee the names and orders for the bands are uniform ? @romeokienzler Currently three formats are supported, strings, integers (including intervals) and HLSBands. There are tests for all those cases.

romeokienzler commented 1 month ago

@Michal-Muszynski can you please test this issue and let us know if it works?

Michal-Muszynski commented 1 month ago

@romeokienzler I have tested integers and strings, the terratorch is able to capture an error when output_bands is not a subset of dataset_bands. However I have found an exception, model channel (bands) and output_bands might be complete different in a config file and there will be no error returned by terratorch, for example, dataset_bands:

CarlosGomes98 commented 1 month ago

@Michal-Muszynski its true, as the code is right now, the model bands currently are checked separately, as they depend on the pretrained model that is being used, the bands it was trained on, and how these were named, rather than the dataset.

I would say this works as intended though, as we have no way of enforcing the naming used by each of the pretrained models to name their bands.

Michal-Muszynski commented 1 month ago

@romeokienzler I have tested channel selection in config files using integer inclusive brackets for output_bands, dataset_bands and bands (model). That works correctly, we just need to remember that output_bands should be a subset of dataset_bands and output_bands should always match bands (model channel).

romeokienzler commented 1 month ago

@Michal-Muszynski can you confirm this is working or it needs further work? can we close?

@Joao-L-S-Almeida suggesting to add a warning to the documentation / or raise exception