Multi Class#

You can also allow each image to belong to multiple categories with the multiclass argument.

# If in a notebook:
%matplotlib ipympl
import matplotlib.pyplot as plt
import numpy as np

from mpl_image_labeller import image_labeller

images = np.random.randn(5, 10, 10)
labeller = image_labeller(
    classes=["good", "bad", "meh"],
    label_keymap=["a", "s", "d"],

The natural representation of this multiclass is a onehot encoding accessible (and settable!) via the labels_onehot property.


If you can you can also get the labels as a ragged list of lists via the labels property