class documentation

Base class for plots that support selection of their points.

Whenever a selection is made in an InteractivePlot, the plot will invoke any selection callback(s) registered on it, reporting to its listeners the IDs of its selected points.

Conversely, the state of an InteractivePlot can be updated by external parties by calling its select_ids method.

Parameters
link_typewhether this plot is linked to "samples", "frames", or "labels"
init_viewa fiftyone.core.collections.SampleCollection defining an initial view from which to derive selection views when points are selected in the plot. This view will also be shown when the plot is in its default state (no selection)
label_fieldsa label field or list of label fields to which points in this plot correspond. Only applicable when link_type == "labels"
selection_modethe initial selection mode to use when updating connected sessions in response to selections in this plot. See selection_mode for details
init_fcna function that can be called with init_view as its argument that returns a fiftyone.core.collections.SampleCollection defining an initial view from which to derive certain types of selection views. See selection_mode for details
Static Method recommend_link_type Recommends a link type for the given info.
Method __init__ Undocumented
Method register_disconnect_callback Registers a callback that can disconnect this plot from a SessionPlot connected to it.
Method register_selection_callback Registers a selection callback for this plot.
Method register_sync_callback Registers a callback that can sync this plot with a SessionPlot connected to it.
Method reset Resets the plot to its default state.
Method select_ids Selects the points with the given IDs in this plot.
Method selection_mode.setter Undocumented
Instance Variable label_fields Undocumented
Property init_view A fiftyone.core.collections.SampleCollection defining the initial view from which to derive selection views when points are selected in the plot.
Property selected_ids A list of IDs of the currently selected points.
Property selection_mode The current selection mode of the plot.
Method _register_disconnect_callback Undocumented
Method _register_selection_callback Undocumented
Method _register_sync_callback Undocumented
Method _select_ids Undocumented
Instance Variable _disconnect_callback Undocumented
Instance Variable _init_fcn Undocumented
Instance Variable _init_fcn_view Undocumented
Instance Variable _init_view Undocumented
Instance Variable _selection_callback Undocumented
Instance Variable _selection_mode Undocumented
Instance Variable _sync_callback Undocumented
Property _selected_ids Undocumented

Inherited from ResponsivePlot:

Method connect Connects this plot, if necessary.
Method disconnect Disconnects the plot, if necessary.
Method freeze Freezes the plot, replacing it with a static image.
Method show Shows the plot.
Property is_connected Whether this plot is currently connected.
Property is_disconnected Whether this plot is currently disconnected.
Property is_frozen Whether this plot is currently frozen.
Property supports_session_updates Whether this plot supports automatic updates in response to session changes.
Method _connect Undocumented
Method _disconnect Undocumented
Method _freeze Undocumented
Method _reopen Undocumented
Method _show Undocumented
Instance Variable _connected Undocumented
Instance Variable _disconnected Undocumented
Instance Variable _frozen Undocumented
Instance Variable _link_type Undocumented

Inherited from Plot (via ResponsivePlot):

Method save Saves the plot.
Method _repr_pretty_ Undocumented
@staticmethod
def recommend_link_type(label_field=None, samples=None): (source)

Recommends a link type for the given info.

Parameters
label_field:Nonethe label field, if any
samples:Nonethe fiftyone.core.collections.SampleCollection, if known
Returns
a (link_type, label_fields, selection_mode, init_fcn) tuple
def __init__(self, link_type='samples', init_view=None, label_fields=None, selection_mode=None, init_fcn=None): (source)
def register_disconnect_callback(self, callback): (source)

Registers a callback that can disconnect this plot from a SessionPlot connected to it.

The typical use case for this function is to serve as the callback for a disconnect button on the plot.

Parameters
callbacka function with no arguments
def register_selection_callback(self, callback): (source)

Registers a selection callback for this plot.

Selection callbacks are functions that take a single argument containing the list of currently selected IDs.

If a selection callback is registered, this plot should invoke it each time their selection is updated.

Parameters
callbacka selection callback
def register_sync_callback(self, callback): (source)

Registers a callback that can sync this plot with a SessionPlot connected to it.

The typical use case for this function is to serve as the callback for a sync button on the plot.

Parameters
callbacka function with no arguments
def reset(self): (source)

Resets the plot to its default state.

def select_ids(self, ids, view=None): (source)

Selects the points with the given IDs in this plot.

Parameters
idsa list of IDs, or None to reset the plot to its default state
view:Nonethe fiftyone.core.view.DatasetView corresponding to the given IDs, if available
@selection_mode.setter
def selection_mode(self, mode): (source)

Undocumented

label_fields: None = (source)

Undocumented

A fiftyone.core.collections.SampleCollection defining the initial view from which to derive selection views when points are selected in the plot.

This view will also be shown when the plot is in its default state (no selection).

@property
selected_ids = (source)

A list of IDs of the currently selected points.

An empty list means all points are deselected, and None means default state (nothing selected or unselected).

If the plot is not connected, returns None.

@property
selection_mode = (source)

The current selection mode of the plot.

This property controls how the current view is updated in response to updates from InteractivePlot instances that are linked to labels or frames.

When link_type is "frames", the supported values are:

  • "select": show video samples with labels only for the selected frames
  • "match": show unfiltered video samples containing at least one selected frame
  • "frames": show only the selected frames in a frames view

When link_type is "labels", the supported values are:

  • "select": show only the selected labels
  • "match": show unfiltered samples containing at least one selected label
  • "patches": show the selected labels in a patches view

Note

In order to use "patches" selection mode, you must have provided an init_fcn when constructing this plot that defines how to create the base patches view. This usually involves to_patches() or to_evaluation_patches()

Note

In order to use "frames" selection mode, you must have provided an init_fcn when constructing this plot that defines how to create the base frames view. This usually involves to_frames()

def _register_disconnect_callback(self, callback): (source)
def _register_selection_callback(self, callback): (source)

Undocumented

def _register_sync_callback(self, callback): (source)
_disconnect_callback = (source)

Undocumented

_init_fcn = (source)

Undocumented

_init_fcn_view = (source)

Undocumented

_init_view = (source)

Undocumented

_selection_callback = (source)

Undocumented

_selection_mode = (source)

Undocumented

_sync_callback = (source)

Undocumented