fast::TensorToSegmentation class

A process object which converts a Tensor to a Segmentation object.

Base classes

class ProcessObject
Abstract base class for all process objects.

Public functions

auto create(float threshold, bool hasBackgroundClass, std::vector<int> channelsToIgnore) -> std::shared_ptr<TensorToSegmentation>
Create instance.
auto getThreshold() const -> float
void setBackgroundClass(bool hasBackgroundClass)
void setChannelsToIgnore(std::vector<int> channels)
Specify list of output channels to ignore.
void loadAttributes() virtual

Protected functions

void execute() override

Protected variables

float m_threshold
bool m_hasBackgroundClass
std::set<int> m_channelsToIgnore

Function documentation

std::shared_ptr<TensorToSegmentation> fast::TensorToSegmentation::create(float threshold, bool hasBackgroundClass, std::vector<int> channelsToIgnore)

Create instance.

Parameters
threshold
hasBackgroundClass Whether the neural network has a channel 0 which represents the "background". Default: true
channelsToIgnore List of output channels to ignore
Returns instance Threshold to accept a channel X as being class X.

void fast::TensorToSegmentation::setBackgroundClass(bool hasBackgroundClass)

Parameters
hasBackgroundClass

Set whether channel 0 of segmentation tensor is the "background" class, thereby getting the label 0 in the resulting Segmentation.

void fast::TensorToSegmentation::setChannelsToIgnore(std::vector<int> channels)

Specify list of output channels to ignore.

Parameters
channels