Single Class#

# If running in a notebook make matplotlib interactive
%matplotlib ipympl

Note

In a notebook you need to make sure to click on the figure in order to give it keyboard focus.

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(
    images, classes=["good", "bad", "meh"], label_keymap=["a", "s", "d"]
)
plt.show()

After you label the images then the labels will be available as a list:

print(labeller.labels)

Or as a onehot encoding

print(labeller.labels_onehot)