sleap.gui.widgets.imagedir

Qt widget for showing images from a directory.

There’s a seekbar to move between images, and an optional drop-down menu to select different filename filters (e.g., “validation.*.png”).

The typical use-case is to show predictions for each training epoch on the training/validation images. For this use-case, there’s a factory method which creates widgets with relevant filters from a given training run path.

class sleap.gui.widgets.imagedir.QtImageDirectoryWidget(directory: str, filters: Optional[List[Tuple[str, str]]] = None)[source]

Qt widget (window) for showing images from directory with seekbar.

Call poll() method to check directory for new files.

Parameters
  • directory – The path for which to search for image files.

  • filters – Filename filters, given as (display name, filter)-tuples, e.g., (“Validation”, “validation.*.png”)

classmethod make_training_vizualizer(run_path: str)sleap.gui.widgets.imagedir.QtImageDirectoryWidget[source]

Factory method for only currently use-case of this widget.

Parameters

run_path – The run path directory for model, should contain viz subdirectory.

Returns

Instance of QtImageDirectoryWidget widget.

poll()[source]

Re-scans directory (using current filter) and updates widget.

setFilter(filter_idx: int)[source]

Set filter (by number) for which files in directory to show.