Skip to content

inputdatadescriptions

inputdatadescriptions

Module for data descriptions used for input

Classes

InputImageDataDescription

Bases: DataDescription, ABC

DataDescription used for models with images as input

Functions
get_input_channel_count abstractmethod
get_input_channel_count()

Returns the number of channels of the input image(s)

Source code in niceml/data/datadescriptions/inputdatadescriptions.py
@abstractmethod
def get_input_channel_count(self) -> int:
    """Returns the number of channels of the input image(s)"""
get_input_image_size abstractmethod
get_input_image_size()

Returns the ImageSize of the input image(s)

Source code in niceml/data/datadescriptions/inputdatadescriptions.py
@abstractmethod
def get_input_image_size(self) -> ImageSize:
    """Returns the ImageSize of the input image(s)"""
get_input_tensor_shape
get_input_tensor_shape()

Returns the 3-dim shape of the input tensor [height, width, channel_count]

Source code in niceml/data/datadescriptions/inputdatadescriptions.py
def get_input_tensor_shape(self) -> Tuple[int, int, int]:
    """Returns the 3-dim shape of the input tensor [height, width, channel_count]"""
    return self.get_input_image_size().to_numpy_shape() + (
        self.get_input_channel_count(),
    )

InputVectorDataDescription

Bases: DataDescription, ABC

DataDescription used by models with vectors as input

Functions
get_input_entry_names abstractmethod
get_input_entry_names()

Returns a name for each vector entry

Source code in niceml/data/datadescriptions/inputdatadescriptions.py
@abstractmethod
def get_input_entry_names(self) -> List[str]:
    """Returns a name for each vector entry"""
get_input_size abstractmethod
get_input_size()

Returns the size of the input vector(s)

Source code in niceml/data/datadescriptions/inputdatadescriptions.py
@abstractmethod
def get_input_size(self) -> int:
    """Returns the size of the input vector(s)"""