deepness.common.channels_mapping.ChannelsMapping¶
- class ChannelsMapping¶
Bases:
objectDefines mapping of model input channels to input image channels (bands). See note at top of this file for details.
Methods
Checks whether all image_channels are composite byte (ImageChannelCompositeByte)
Checks whether all image_channels are standalone bands (ImageChannelStandaloneBand)
Get the same channels mapping as we have right now, but without the mapping itself (so just a definition of inputs and outputs)
Get ImageChannel which should be used for the specified model input
Similar to 'get_image_channel_for_model_input', but return an index in array of inputs, instead of ImageChannel
Get the current image channels definition
Get the mapping of model input channels to image channels, but as a list (e.g.
Get number of image input channels
Get number of model input channels
Get number of model output channels
Load self._mapping from a plain list of channels (which is saved in config)
Set image_channel_index which should be used for this model input
Set what are the image channels
Set how many input channels does the model has :param number_of_model_inputs: :type number_of_model_inputs: int
Set the number of model input channels to be the same as number of image channels
Set how many output channels does the model has
Attributes
INVALID_INPUT_CHANNEL- are_all_inputs_composite_byte()¶
Checks whether all image_channels are composite byte (ImageChannelCompositeByte)
- are_all_inputs_standalone_bands()¶
Checks whether all image_channels are standalone bands (ImageChannelStandaloneBand)
- get_as_default_mapping()¶
Get the same channels mapping as we have right now, but without the mapping itself (so just a definition of inputs and outputs)
- Return type:
- get_image_channel_for_model_input(model_input_number: int) ImageChannel¶
Get ImageChannel which should be used for the specified model input
- Parameters:
model_input_number (int) – Model input number, counted from 0
- Return type:
- get_image_channel_index_for_model_input(model_input_number) int¶
Similar to ‘get_image_channel_for_model_input’, but return an index in array of inputs, instead of ImageChannel
- get_image_channels() List[ImageChannel]¶
Get the current image channels definition
- Return type:
List[ImageChannel]
- get_mapping_as_list() List[int]¶
Get the mapping of model input channels to image channels, but as a list (e.g. to store it in QGis configuration)
- Return type:
List[int]
- get_number_of_image_channels() int¶
Get number of image input channels
- Return type:
int
- get_number_of_model_inputs() int¶
Get number of model input channels
- Return type:
int
- get_number_of_model_output_channels() int¶
Get number of model output channels
- Return type:
int
- load_mapping_from_list(mapping_list: List[int])¶
Load self._mapping from a plain list of channels (which is saved in config)
- set_image_channel_for_model_input(model_input_number: int, image_channel_index: int) ImageChannel¶
Set image_channel_index which should be used for this model input
- set_image_channels(image_channels: List[ImageChannel])¶
Set what are the image channels
- Parameters:
image_channels (List[ImageChannel]) – Image channels to set
- set_number_of_model_inputs(number_of_model_inputs: int)¶
Set how many input channels does the model has :param number_of_model_inputs: :type number_of_model_inputs: int
- set_number_of_model_inputs_same_as_image_channels()¶
Set the number of model input channels to be the same as number of image channels
- set_number_of_model_output_channels(number_of_output_channels: int)¶
Set how many output channels does the model has
- Parameters:
number_of_output_channels (int) –