Ecto-Trigger 1.0
|
Public Member Functions | |
__init__ (self, weights_file) | |
generate_saliency_map (self, input_image_path, output_path) | |
Public Attributes | |
weights_file = weights_file | |
model = self._load_model() | |
input_shape = self.model.input_shape[1:] | |
Protected Member Functions | |
_load_model (self) | |
Static Protected Member Functions | |
_preprocess_image (image_path, input_shape) | |
A class to generate a saliency map for an input image using a trained model.
__init__ | ( | self, | |
weights_file ) |
Initialize the SaliencyMapGenerator. Args: weights_file (str): Path to the trained model weights file.
|
protected |
Load the model using the provided weights file. Returns: tf.keras.Model: Loaded Keras model.
|
staticprotected |
Preprocess the input image. Args: image_path (str): Path to the input image. input_shape (tuple): Shape to resize the image to. Returns: tuple: Preprocessed image array and the original image.
generate_saliency_map | ( | self, | |
input_image_path, | |||
output_path ) |
Generate and save a saliency map for the input image. Args: input_image_path (str): Path to the input image. output_path (str): Path to save the saliency map.
input_shape = self.model.input_shape[1:] |
model = self._load_model() |
weights_file = weights_file |