code: def generate_scores_map(
      self, embedding, out_shape, gaussian_blur=True
  ):
      # Nearest Neighbours distances
      B, C, H, W = embedding.shape
      embedding = embedding.transpose((0, 2, 3, 1)).reshape(
          (B, H * W, C)
      )
      distances = self.nearest_neighbors(
          embedding=embedding, n_neighbors=9
      )
      distances = distances.transpose((2, 0, 1))  # n_neighbors, B, HW
      image_score = []
      for i in range(B):
          image_score.append(
              self.compute_image_anomaly_score(distances[:, i, :])
          )
      distances = distances[0, :, :].reshape((B, H, W))
      score_map = postporcess_score_map(
          distances, out_shape, gaussian_blur
      )
      return score_map, np.array(image_score)
  
imports: import numpy
  from tqdm import tqdm
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.vision.models.resnet import resnet18, resnet50, wide_resnet50_2
  from scipy.ndimage import gaussian_filter
  from qinspector.cvlib.workspace import register
  from qinspector.uad.utils.utils import cdist, cholesky_inverse, mahalanobis, mahalanobis_einsum, orthogonal, svd_orthogonal
  from qinspector.uad.utils.k_center_greedy import KCenterGreedy
label_desc: Use image node_id 11 for calling the PatchCore obj's underlying member method code with example usage: obj.generate_scores_map(embedding, out_shape, gaussian_blur) and returns: score_map,  np