mpl_image_labeller package#

Module contents#

class image_labeller(images, classes, multiclass=False, label_keymap: Union[List[str], str] = '1234', title=None, init_labels=None, init_labels_onehot=None, labelling_advances_image: bool = True, N_images=None, fig: Optional[matplotlib.figure.Figure] = None, **imshow_kwargs)[source]#

Bases: object

property ax#

readonly - The Axes object the image’s are displayed on.

property image_index#

int the index of the currently displayed image.

property labels#

The current labels as a list of lists or a list of strings.

property labels_onehot#

The current labels as a one hot encoding.

on_image_changed(func)[source]#

Connect func as a callback function for when the displayed image is changed. func will receive the index of the new image and the image. fig.canvas.draw_idle will be called after the callback is executed so if you are modifying the figure then you do not need to explicitly call draw yourself.

Parameters
funccallable

Function to call when a point is added.

Returns
int

Connection id (which can be used to disconnect func).

on_label_assigned(func)[source]#

Connect func as a callback function for when a label is assigned to an image. func will receive the index of the image and the new class.

Parameters
funccallable

Function to call when a point is added.

Returns
int

Connection id (which can be used to disconnect func).