def METHOD_NAME(self, dataset_dir, is_test=False):
    IMG_EXTENSIONS = ('.jpg', '.jpeg', '.png', '.ppm', '.bmp', '.pgm',
                      '.tif', '.tiff', '.webp')
    # read
    if is_test:
        datasubset_dir = os.path.join(dataset_dir, 'test')
    else:
        datasubset_dir = os.path.join(dataset_dir, 'train')
    class_names, class_to_idx = _find_classes(datasubset_dir)
    # num_classes = len(class_names)
    image_paths = []
    labels = []
    for class_name in class_names:
        classes_dir = os.path.join(datasubset_dir, class_name)
        for img_path in glob.glob(os.path.join(classes_dir, '*')):
            if not img_path.lower().endswith(IMG_EXTENSIONS):
                continue
            image_paths.append(img_path)
            labels.append(class_to_idx[class_name])
    image_paths = np.array(image_paths)
    labels = np.array(labels)
    return image_paths, labels, len(class_names)