def METHOD_NAME(self):
    def reader():
        IMG_EXTENSIONS = ('.jpg', '.jpeg', '.png', '.ppm', '.bmp', '.pgm',
                          '.tif', '.tiff', '.webp')
        target_size = 256
        crop_size = 224
        for i, img_path in enumerate(self.image_paths):
            if not img_path.lower().endswith(IMG_EXTENSIONS):
                continue
            img = cv2.imread(img_path)
            if img is None:
                logging.info(img_path)
                continue
            img = resize_short(img, target_size, interpolation=None)
            img = crop_image(img, crop_size, center=self.is_test)
            img = img[:, :, ::-1]
            img = np.expand_dims(img, axis=0)
            img = preprocess_image(img, not self.is_test)
            yield img, self.labels[i]
    return reader