code: def get_num_filters(layer):
      """Determines the number of filters within the given `layer`.
  
      Args:
          layer: The keras layer to use.
  
      Returns:
          Total number of filters within `layer`.
          For `keras.layers.Dense` layer, this is the total number of outputs.
      """
      # Handle layers with no channels.
      if K.ndim(layer.output) == 2:
          return K.int_shape(layer.output)[-1]
  
      channel_idx = (
          1 if K.image_data_format() == "channels_first" else -1
      )
      return K.int_shape(layer.output)[channel_idx]
  
file_path: keras-vis/vis/visualization/__init__.py
imports: from __future__ import absolute_import
  from .activation_maximization import visualize_activation_with_losses
  from .activation_maximization import visualize_activation
  from .saliency import visualize_saliency_with_losses
  from .saliency import visualize_saliency
  from .saliency import visualize_cam_with_losses
  from .saliency import visualize_cam
  from keras import backend
label_desc: Use image node_id 1 for calling a global function with example usage: get_num_filters(layer) and returns: K, K