def get_features(self, images_array):
    ' takes a batch of images as a 4-d array and returns the (flattened) imagenet features for those images as a 2-d array '
    if self.include_top:
        raise Exception('getting features from a classification model with include_top=True is currently not supported')
    if (images_array.ndim != 4):
        raise Exception('invalid input shape for images_array, expects a 4d array')
    logger.debug(f'preprocessing {images_array.shape[0]} images')
    images_array = self.preprocess(images_array)
    logger.debug(f'computing image features')
    image_features = self.model.predict(images_array)
    if self.n_channels:
        logger.debug(f'truncating to first {self.n_channels} channels')
        image_features = image_features.T[:self.n_channels].T
    shape = image_features.shape
    return image_features.reshape(shape[0], np.prod(shape[1:]))
takes a batch of images as a 4-d array and returns the (flattened) imagenet features for those images as a 2-d array
def get_features(self, images_array):
    '  '
    if self.include_top:
        raise Exception('getting features from a classification model with include_top=True is currently not supported')
    if (images_array.ndim != 4):
        raise Exception('invalid input shape for images_array, expects a 4d array')
    logger.debug(f'preprocessing {images_array.shape[0]} images')
    images_array = self.preprocess(images_array)
    logger.debug(f'computing image features')
    image_features = self.model.predict(images_array)
    if self.n_channels:
        logger.debug(f'truncating to first {self.n_channels} channels')
        image_features = image_features.T[:self.n_channels].T
    shape = image_features.shape
    return image_features.reshape(shape[0], np.prod(shape[1:]))