ncalab.visualization.animation

Attributes

animator_style_dark

animator_styles

Classes

AnimatorStyle

Animator

Responsible for rendering NCA predictions as GIFs.

Functions

draw_segmentation_overlay(image, mask, style)

Module Contents

class ncalab.visualization.animation.AnimatorStyle(color_background, color_overlay, color_title, color_progress, underline: bool = True, progress_h: int = 3)
color_background
color_overlay
color_title
color_progress
underline = True
progress_h = 3
apply(fig, ax)
ncalab.visualization.animation.animator_style_dark
ncalab.visualization.animation.animator_styles
ncalab.visualization.animation.draw_segmentation_overlay(image, mask, style)
class ncalab.visualization.animation.Animator(nca: ncalab.models.AbstractNCAModel, seed: torch.Tensor, steps: int | None = None, interval: int = 100, repeat: bool = True, repeat_delay: int = 10000, overlay: bool = False, show_timestep: bool = True, hidden: bool = False, show_input: bool = False, style: str | AnimatorStyle = 'dark')

Responsible for rendering NCA predictions as GIFs.

Parameters:
  • nca (ncalab.AbstractNCAModel) – NCA model instance

  • seed (torch.Tensor) – Input image for the NCA model

  • steps (int, optional) – Number of NCA prediction steps per sample, defaults to 100

  • interval (int, optional) – Time of each frame (milliseconds), defaults to 100

  • repeat (bool, optional) – Whether to loop the animation, defaults to True

  • repeat_delay (int, optional) – Time after which the animation is repeated (milliseconds), defaults to 10000

  • overlay (bool, optional) – Whether to overlay output channel (segmentation mask), defaults to False

  • show_timestep (bool, optional) – Whether to display timestep in caption, defaults to True

animation_fig
save(path: str | pathlib.Path)

Save generated figure as GIF

Parameters:

path (str | Path) – Output path