deepness.common.channels_mapping.ChannelsMapping

class ChannelsMapping

Bases: object

Defines mapping of model input channels to input image channels (bands). See note at top of this file for details.

Methods

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)

get_image_channel_for_model_input

Get ImageChannel which should be used for the specified model input

get_image_channel_index_for_model_input

Similar to 'get_image_channel_for_model_input', but return an index in array of inputs, instead of ImageChannel

get_image_channels

Get the current image channels definition

get_mapping_as_list

Get the mapping of model input channels to image channels, but as a list (e.g.

get_number_of_image_channels

Get number of image input channels

get_number_of_model_inputs

Get number of model input channels

get_number_of_model_output_channels

Get number of model output channels

load_mapping_from_list

Load self._mapping from a plain list of channels (which is saved in config)

set_image_channel_for_model_input

Set image_channel_index which should be used for this model input

set_image_channels

Set what are the image channels

set_number_of_model_inputs

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

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:

ChannelsMapping

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:

ImageChannel

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) –