What are the class names?

How do we get the class names from ImageDataLoaders please?
I can see that get_c(dls) will get me the number of classes.
How do I get the class names, pls?

from fastai2.vision.all import *
path = untar_data(URLs.PETS)/‘images’
def is_cat(x): return x[0].isupper()
dls = ImageDataLoaders.from_name_func(
path, get_image_files(path), valid_pct=0.2, seed=42,
label_func=is_cat, item_tfms=Resize(224))
learn = cnn_learner(dls, resnet34, metrics=error_rate)
learn.fine_tune(1)

dls.vocab :slight_smile: (I forget this easily too)

3 Likes