Visualizer Function

Tensorleap enables visualizations of data within the model graph by connecting a Visualizer block to a node's output tensor. This allows to visualize the model's input, prediction, ground truth, or any inner tensor.

By default, these naive Visualizers are provided (in the UI):

  • Image

  • Graph

  • Numeric

  • HorizontalBar

  • Text

  • ImageMask

  • TextMask

These naive visualizers shows the data as-is, but in many cases, there is a need to write our own Visualizer Function to make sense of the data. For example:

  • Converting tokenized data to text words

  • Custom post-processing

  • Draw landmarks on images

  • Apply transforms

Example a visualizer function:

def text_visualizer_func(data: np.ndarray) -> LeapText:
    tokenizer = leap_binder.custom_tokenizer
    texts = tokenizer.sequences_to_texts(data)
    return LeapText(texts)

These functions should return one of the following types defined in visualizer_classes.

The visualizer_classes pages contain additional, visualizer specific, examples. Moreover, full script usage can be found at Integration Script.

Guides

Full examples can be found at the Dataset Integration section of the following guides:

Last updated