diff --git a/terratorch/models/backbones/utils.py b/terratorch/models/backbones/utils.py index e415e9b4..cb680f76 100644 --- a/terratorch/models/backbones/utils.py +++ b/terratorch/models/backbones/utils.py @@ -19,12 +19,14 @@ def _estimate_in_chans(model_bands: list[HLSBands] | list[str] | tuple[int, int] is_sublist, requires_special_eval = _are_sublists_of_int(model_bands) # Bands as intervals limited by integers + # The bands numbering follows the Python convention (starts with 0) + # and includes the extrema (so the +1 in order to include the last band) if requires_special_eval: if is_sublist: - in_chans = sum([i[-1] - i[0] for i in model_bands]) + in_chans = sum([i[-1] - i[0] + 1 for i in model_bands]) else: - in_chans = model_bands[-1] - model_bands[0] + in_chans = model_bands[-1] - model_bands[0] + 1 else: in_chans = len(model_bands)