sleap.gui.overlays.confmaps

Overlay for confidence maps.

Currently a DataOverlay gets data from a model (i.e., it runs inference on the current frame) and then uses a ConfMapsPlot object to show the resulting confidence maps.

Example

>>> cm = ConfMapsPlot(conf_data.get_frame(0))
>>> window.view.scene.addItem(cm)
class sleap.gui.overlays.confmaps.ConfMapPlot(confmap: numpy.array = None, color=[255, 255, 255], *args, **kwargs)[source]

QGraphicsPixmapItem object for drawing single channel of confidence map.

Parameters
  • confmap (numpy.array) – (h, w) array of one confidence map channel.

  • color (list) – optional (r, g, b) array for channel color.

Returns

None.

Note

In most cases this should only be called by ConfMapsPlot.

get_conf_image() → PySide2.QtGui.QImage[source]

Converts array data stored in object to QImage.

Returns

QImage.

class sleap.gui.overlays.confmaps.ConfMapsPlot(frame: numpy.array = None, show=None, show_box=True, *args, **kwargs)[source]

QGraphicsObject to display multiple confidence maps in a QGraphicsView.

Parameters
  • frame (numpy.array) – Data for one frame of confidence map data. Shape of array should be (channels, height, width).

  • show (list, optional) – List of channels to show. If None, show all channels.

  • show_box (bool, optional) – Draw bounding box around confidence maps.

Returns

None.

When initialized, creates one child ConfMapPlot item for each channel.

boundingRect() → PySide2.QtCore.QRectF[source]

Method required by Qt.

paint(painter, option, widget=None)[source]

Method required by Qt.

sleap.gui.overlays.confmaps.demo_confmaps(confmaps, video, scale=None, standalone=False, callback=None)[source]

Demo function.

sleap.gui.overlays.confmaps.show_confmaps_from_h5(filename, input_format='channels_last', standalone=False)[source]

Demo function.